It is currently April 23rd, 2024, 1:12 pm

Help with RegEx in WebParser please?

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with RegEx in WebParser please?

Post by jsmorley »

JayOtt wrote: February 26th, 2019, 2:48 pm It's all good; I've made the actual meter ignore the service interruptions with a kinda buffer Measure using Calc.

Code: Select all

[MeasureUser10thItemPre]
Measure=WebParser
URL=[MeasureFile]
StringIndex=10

;Measure buffer thing
[MeasureUser10thItem]
Measure=Calc
Formula=MeasureUser10thItemPre

[MeterUser10thItem]
Meter=String
MeasureName=MeasureUser10thItem
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
... and so for whatever reason WebParser doesn't get anything useful from the URL, it still displays whatever that calculation was last. :D
Not sure you really need that, as if a WebParser parent measure "fails", the STRING value of all its children will maintain their previous value. So if you just use the value of the child WebParser measure, which is always a string no matter what it looks like, in the meter, all will be well.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with RegEx in WebParser please?

Post by jsmorley »

The values for WebParser child measures are actually never updated by themselves. They are only set and updated by the parent. If the parent measure fails, the child measures are not touched. They will just keep whatever previous value they had.

This is the behavior you want, as with any WebParser-based skin, you actually get more transitory internet / network errors from time to time than you might think. Hiccups in your connection to a site are not at all uncommon. You want that to be visibly seamless, and not have the skin overreacting to problems that likely only last one UpdateRate cycle.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with RegEx in WebParser please?

Post by balala »

JayOtt wrote: February 26th, 2019, 2:48 pm It's all good; I've made the actual meter ignore the service interruptions with a kinda buffer Measure using Calc.

Code: Select all

[MeasureUser10thItemPre]
Measure=WebParser
URL=[MeasureFile]
StringIndex=10

;Measure buffer thing
[MeasureUser10thItem]
Measure=Calc
Formula=MeasureUser10thItemPre

[MeterUser10thItem]
Meter=String
MeasureName=MeasureUser10thItem
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
... and so if for whatever reason WebParser doesn't get anything useful from the URL, it still displays whatever that calculation was last. :D
Are you sure you need the [MeasureUser10thItem] measure? I think you could get the same result, replacing the existing MeasureUser10thItem measure name in the MeasureName option of the [MeterUser10thItem] meter, with MeasureUser10thItemPre (MeasureName=MeasureUser10thItemPre). Finally:
jsmorley wrote: February 26th, 2019, 2:31 pm To be honest, since this is a transitory error, I'd be tempted not to alter the meters. They will just keep their old values until the condition corrects itself and then will change to the new ones. It's all visibly seamless.
(https://forum.rainmeter.net/viewtopic.php?f=5&t=31560#p159588)