First of all, I didn't look at the whole skin yet. I will take a look at it, but I don't guarantee anything.
Now that being said, you should be aware that:
1. There are much easier ways of achieveing what you (probably) want to achieve. The first step (the ipapi.co one) is useful, but you don't need to query another site (i.e. weather.codes in the posted example) to get your Weather.com location code - you can simply use your latitude and longitude (that you got from ipapi.co) directly into weather.com, instead of a "location code", like
here. In other words, this will save you a step in the process: instead of querying 3 sites for something, you'll query just 2, where the 2nd will be weather.com itself.
2. Just from looking at the parts of the code you posted, I can see a couple of "problems":
- you don't seem to do anything with the
#URLcurrent# variable there. Yes, you set it correctly, but you didn't
command the target WebParser measure to update or anything like that, so the variable isn't used from a practical point of view (until the next update set by
#UpdateRate#, of course, but I have no idea when that is set to happen)
- you didn't add
DynamicVariables=1 to the
[@CurrentAll] measure, so the measure won't get the actual value of either
#URLcurrent# or
#UpdateRate#, in the (highly probably) case they both dynamically change while the skin is active.
- I could be wrong, but from my experience, you'll have little chances of success with:
Code: Select all
[!SetVariable URLcurrent https://weather.com/#Language#/weather/today/l/[MeasureWeatherCode]]
from the
[MeasureWeatherCode] measure, because the WebParser
parent measure is
not its capture. The way this should be done is to create a WebParser
child measure that grabs the capture from
[MeasureWeatherCode]'s RegExp (i.e. the
(.*) from
(?siU)<dt>(.*)</dt>) using
StringIndex=1, then try setting the variable from there (using, say, that measure's OnUpdateAction option to do it).
- you seem to try to make your
[MeasureWeatherCode] measure both a parent and a child WebParser measure. I doubt that's the right way to do it. Instead, you should be aware that an
actual URL is used in a
parent WebParser measure, while in a child WebParser measure, the
URL option usually takes the form of its parent measure and the
StringIndex option is normally used in the child, and not the parent. I suggest checking a bit the "WebParser and Dynamic Variables" section
here (and the skin samples) to get some hints on how things should be approached.
Hopefully, some of the things above will help you correct or improve the code and get what you want in your skin. If not, I'll think about posting a basic sample of getting the needed result, without trying too much to modify the packed skin you linked to. Then, it will be up to you to port what is useful into the original skin and try to make it work as well as that sample.
EDIT
And here is the sample (I just realized that it took me less to build this sample than to write the explanation, LOL ... but then, maybe both will help):
Code: Select all
[Variables]
Language=en-GB
URLCurrent=""
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
---Measures---
[MeasureLocationGeocode]
Measure=WebParser
URL=https://ipapi.co/json
RegExp="(?siU).*"latitude": (.*),.*"longitude": (.*),.*"
UpdateRate=600
FinishAction=[!UpdateMeasureGroup GeocodeGroup][!SetVariable URLCurrent "https://weather.com/#Language#/weather/today/l/[MeasureLatitude],[MeasureLongitude]"][!EnableMeasure "@CurrentAll"][!UpdateMeasure "@CurrentAll"][!CommandMeasure @CurrentAll "Update"]
DynamicVariables=1
[MeasureLatitude]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationGeocode]
StringIndex=1
UpdateDivider=-1
[MeasureLongitude]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationGeocode]
StringIndex=2
UpdateDivider=-1
[@CurrentAll]
Disabled=1
Measure=WebParser
Group=Weather | WeatherCurrent
URL="#URLCurrent#"
RegExp="(?siU).*"vt1observation":\{.*,"temperature":(.*),.*\}.*"
FinishAction=[!UpdateMeasureGroup WeatherGroup]
UpdateRate=-1
DynamicVariables=1
[MeasureTemperature]
Group=WeatherGroup
Measure=WebParser
URL=[@CurrentAll]
StringIndex=1
UpdateDivider=-1
---Meters---
[MeterAutoLocateDemo]
Meter=STRING
X=5
Y=5
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureLatitude
MeasureName2=MeasureLongitude
MeasureName3=MeasureTemperature
Text="Latitude = %1#CRLF#Longitude = %2#CRLF#Temperature = %3 [\x00B0]C"
DynamicVariables=1
Most of these measures have
UpdateDivider=-1 set on them, just to be on the safe side (me, I like to do things on demand). Everything is triggered step by step by the
[MeasureLocationGeocode]'s update, and the relevant data is displayed in
[MeterAutoLocateDemo]. Good luck in adapting this in your skin.