Do NOT use UpdateDivider on WebParser measures.
Do NOT use !UpdateMeasure on WebParser measures.
Do NOT use Disabled or !DisableMeasure / !EnableMeasure on WebParser measures.
WebParser measures should be controlled entirely by UpdateRate.
UpdateRate is a counter that tells WebParser how often to go out to the remote resource and get the data. The counter is incremented by 1 each time the parent measure is updated, until it reached the value set for UpdateRate, when it resets to zero and goes out for the data. When the values are retrieved, the parent measure automatically sets the values for all child measures.
UpdateRate does not have a
-1 setting equivalent to what works with UpdateDivider, but you can just use a huge number to effectively stop it from going out to the remote resource until directed to.
Then you can use !CommandMeasure to override UpdateRate and force WebParser to go out to the remote resource on demand.
https://docs.rainmeter.net/manual/measures/webparser/#CommandMeasureUpdate
Again, do NOT use !UpdateMeasure on WebParser measures. all that will do is increment the UpdateRate counter by 1.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
[MeasureTime]
Measure=Time
Format=%#M.%#S
IfCondition=(Trunc(MeasureTime) = 0) && (Frac(MeasureTime) = 0)
IfTrueAction=[!CommandMeasure MeasureSite "Update"]
[MeasureSite]
Measure=WebParser
URL=https://www.timeanddate.com/worldclock/usa/alexandria
RegExp=(?siU)<span id=ct class=h1>(.*)</span>
UpdateRate=604800
FinishAction=[!UpdateMeter MeterDate][!Redraw]
[MeasureChild]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
[MeterDate]
Meter=String
MeasureName=MeasureChild
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=It is %1
That will get the time In Alexandria, Virginia when the skin is loaded or refreshed, and after that only when the top of each hour is reached.
Oh, and once a week, when the UpdateRate counter reaches 604800 seconds... Make that number even larger if that bothers you. 31536000 would more or less be once a year...
WebParser works by going out to the remote resource each time the counter controlled by UpdateRate is zero. This will be when the skin is first loaded or refreshed, and when the counter reaches the value of UpdateRate and is started over at zero to start counting again.
Using UpdateDivider or Disabled / Enabled on WebParser parent or child measures is generally not the way to go. All that is done on the update of a WebParser parent measure is that the UpdateRate counter is incremented by 1. Nothing is done on any WebParser child measures on each update, as their values are entirely controlled by the parent.
Leave UpdateDivider on all WebParser measure set to the default value of 1.
Note that Disable / Enable CAN be used on WebParser parent measures, perhaps to have a measure that doesn't execute even once on skin load or refresh until it is enabled and updated by the value of some other measure in the skin, but the cases where this makes sense are going to be few, and almost always more trouble than it is worth.