I am attempting to create a geo-location weather skin.
I have the following code to retrieve, public ip, city, state, country
| Code: |
[MeasurePublicIP]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://www.find-ip-address.org/
;http://www.geoip.co.uk/
RegExp="ip \+\= "IP Address Lookup Location:";\n\t+ip \+\= "(.*?)";\n\t+ip \+\= "(.*?) \((.*?)\) in (.*?)
[MeasureLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasurePublicIP]
StringIndex=2
[MeasureLocation2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasurePublicIP]
Substitute=" ":"_"
StringIndex=3
[MeasureLocation3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasurePublicIP]
StringIndex=4
|
stringindex2 = city
stringindex3 = state
stringindex4 = country
| Code: |
[MeasureWeather]
Measure=Plugin
debug=2
Plugin=Plugins\WebParser.dll
URL=http://www.weather.com/outlook/weatherbystate/west_virginia-b
RegExp="/weather/local/(.*?)">Beckley"
StringIndex=1
UpdateRate=3600
|
I'm looking for how to modify the URL so that
west_virginia is provided by stringindex3
b is povided by left(stringindex2,1)
Beckley is provided by stringindex2
Is there a way to dynamically create the URL and regular expression?
I've tested the hardcoding and this would provide me with proper location code again, I would have to provide it as a dynamic input to the xoap.weather lookup.