Not a stupid question at all...
When you have a second WebParser parent measure that is using / dependent on a first WebParser parent measure, you have to account for the fact that at first, when the skin first is loaded or refreshed, they will both be executed in the first update cycle, and at that time, there won't be anything from the first one available for the second one to use. That's wouldn't be a huge problem, since by the second update cycle or so the information will be there in the first one, but since WebParser parent measures only update every 10 minutes by default, the second one won't get or use this information until then.
The FinishAction on the first parent measure will "poke" the second one when the information is available, and tell it "hey, I'm ready now, come get it!".
Now, even though this will work fine, you will in fact get one single error message RegExp matching error (-1) in the log when the skin is first loaded or refreshed. When that second parent measure tries to go out and get information, but can't since it doesn't yet have what it needs from the first. I hate transient error messages, so it can be avoided like this:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
[MeasureLocation]
Measure=WebParser
Url=http://ip-api.com/json
RegExp=(?siU)"city":"(.*)".*"country":"(.*)".*"regionName":"(.*)"
FinishAction=[!EnableMeasure MeasureWeatherCode][!CommandMeasure MeasureWeatherCode "Update"]
[MeasureCity]
Measure=WebParser
URL=[MeasureLocation]
StringIndex=1
[MeasureCountry]
Measure=WebParser
URL=[MeasureLocation]
StringIndex=2
[MeasureRegion]
Measure=WebParser
URL=[MeasureLocation]
StringIndex=3
[MeasureWeatherCode]
Measure=WebParser
Url=http://wxdata.weather.com/wxdata/search/search?where=[&MeasureCity] [&MeasureRegion] [&MeasureCountry]
Disabled=1
DynamicVariables=1
RegExp=(?siU).*<loc id="(.*)"
FinishAction=[!UpdateMeter *][!Redraw]
[MeasureCode]
Measure=WebParser
URL=[MeasureWeatherCode]
StringIndex=1
[MeterBack]
Meter=Shape
Shape=Rectangle 0.5,0.5,300,130 | StrokeWidth 1 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,120
[MeterLocation]
Meter=String
MeasureName=MeasureCity
MeasureName2=MeasureRegion
MeasureName3=MeasureCountry
MeasureName4=MeasureCode
X=(300/2)
Y=(130/2)
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
StringAlign=CenterCenter
InlineSetting=Size | 12
InlinePattern=#CRLF#.*$
InlineSetting2=Color | 106,255,87,255
InlinePattern2=#CRLF#.*$
Text=%1#CRLF#%2#CRLF#%3#CRLF##CRLF#%4
So you just don't let the second measure execute at all until the first one is done. Then you tell it "Ok, wake up and go do your thing, right now!".