I don't think the culprit is StringIndex2 as such.
https://docs.rainmeter.net/tips/webparser-using-stringindex2/
There must be something else about this that is throwing WebParser.
and I need to change the URL that example uses. That feed is long dead...
It is currently September 1st, 2024, 2:33 am
Weather Skins Not Working
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Understood - I'll build a basic skin and see if it happens there as well. Just to take out a possible (yet unlikely, in my view) mistake in my code.jsmorley wrote: ↑August 2nd, 2020, 1:32 am I don't think the culprit is StringIndex2 as such.
https://docs.rainmeter.net/tips/webparser-using-stringindex2/
There must be something else about this that is throwing WebParser.
and I need to change the URL that example uses. That feed is long dead...
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
I'd be tempted to use FinishAction on the "parent" to throw a [!CommandMeasure MeasureName "Update"] at the "intermediate" measure to see if that has any effect.
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Here is the simple test. This assumes there is a UCS-2 LE BOM file called SomeFile.txt in the current skin folder, having this contents:jsmorley wrote: ↑August 2nd, 2020, 1:32 am I don't think the culprit is StringIndex2 as such.
https://docs.rainmeter.net/tips/webparser-using-stringindex2/
There must be something else about this that is throwing WebParser.
and I need to change the URL that example uses. That feed is long dead...
Code: Select all
This is a unicode code point: \u0219 and this is not: u0219.
Code: Select all
[Variables]
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[MeasureParent]
Measure=WebParser
URL=file://#CURRENTPATH#SomeFile.txt
CodePage=1200
RegExp=^(.*)$
[MeasureChild]
Measure=WebParser
URL=[MeasureParent]
StringIndex=1
RegExp=(?siU)^(.*) and (.*)$
StringIndex2=1
DecodeCodePoints=1
[MeasureGrandchild]
Measure=WebParser
URL=[MeasureChild]
StringIndex=1
RegExp=(?siU)^(.*): (.*)$
StringIndex2=2
;DecodeCodePoints=1
---Meters---
[MeterTest]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureGrandchild
Text="Test = %1"
DynamicVariables=1
![Confused :confused:](./images/smilies/bn.gif)
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
Ah, well, that makes some sense. Much like Substitute, the DecodeCodePoints option is acting on the string value of the measure, no doubt when the string value is "asked for", and does not "change" the indexed value of the intermediate child measure. Since the URL=[SomeMeasure] option in WebParser is not "asking for the string value" of the measure in question, but internal to WebParser saying "let me use your data". I can see why DecodeCodePoints isn't going to work until you actually use the string value of the measure someplace. It is only the "grandchild" that is ever being displayed.
Don't be fooled by the log, it is "asking for the string value" of the child measure. So the DecodeCodePoints is working there. That doesn't in any way mean that the value of the child measure is actually "changed" by the DecodeCodePoints.
I don't know if it helps your situation, but you can "ask for" and use the "string value" of a WebParser measure in another WebParser measure like this:
URL=[&SomeMeasureName]
DynamicVariables=1
Just keep in mind that things like Substitute, DecodeCharacterReference, DecodeCodePoints and any another options that might be eluding me at the moment that "manipulate" the value of a measure, do NOT "change" the value of the measure. They are applied when the value of the measure is "asked for" by something else.
Don't be fooled by the log, it is "asking for the string value" of the child measure. So the DecodeCodePoints is working there. That doesn't in any way mean that the value of the child measure is actually "changed" by the DecodeCodePoints.
I don't know if it helps your situation, but you can "ask for" and use the "string value" of a WebParser measure in another WebParser measure like this:
URL=[&SomeMeasureName]
DynamicVariables=1
Just keep in mind that things like Substitute, DecodeCharacterReference, DecodeCodePoints and any another options that might be eluding me at the moment that "manipulate" the value of a measure, do NOT "change" the value of the measure. They are applied when the value of the measure is "asked for" by something else.
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Yep, I was just going to compare it to the way Substitute doesn't really change the value of the measure as well. Well, it looks like I'll have to use the option on the grandchildren then. The good thing is that in my skin, due to the way I built it, there are below 50 of them, unlike in other skins (don't ask me which...) that have hundreds of them.jsmorley wrote: ↑August 2nd, 2020, 2:13 am Ah, well, that makes some sense. Much like Substitute, the DecodeCodePoints option is acting on the string value of the measure, no doubt when the string value is "asked for", and does not "change" the indexed value of the intermediate child measure. Since the URL=[SomeMeasure] option in WebParser is not "asking for the string value" of the measure in question, but internal to WebParser saying "let me use your data". I can see why DecodeCodePoints isn't going to work until you actually use the string value of the measure someplace. It is only the "grandchild" that is ever being displayed.
Don't be fooled by the log, it is "asking for the string value" of the child measure. So the DecodeCodePoints is working there. That doesn't in any way mean that the value of the child measure is actually "changed" by the DecodeCodePoints.
![Confused :???:](./images/smilies/bw.gif)
And of course, one way or another, it works, that's the most important thing.
P.S. Hopefully I won't get into similar issues when I pass the value of a code point decoded child (without other children) to a String measure, cause I'm doing that for forecast data, as String measures are friendlier to dynamic variables than WebParser ones (which need a command update, i.e. another polling to the site, to get them)...
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
Code: Select all
[Variables]
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[MeasureParent]
Measure=WebParser
URL=file://#CURRENTPATH#SomeFile.txt
CodePage=1200
RegExp=^(.*)$
[MeasureChild]
Measure=WebParser
URL=[MeasureParent]
StringIndex=1
RegExp=(?siU)^(.*) and (.*)$
StringIndex2=1
[MeasureGrandchild]
Measure=WebParser
URL=[MeasureChild]
StringIndex=1
RegExp=(?siU)^(.*): (.*)$
StringIndex2=2
DecodeCodePoints=1
---Meters---
[MeterTest]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureGrandchild
Text="Test = %1"
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
It should be fine passing the WebParser child value with DecodeCodePoints to a String measure.
[MeasureString]
Measure=String
String=[SomeMeasure]
DynamicVariables=1
Is always by its nature "asking for" the string value of that section variable, and any DecodeCodePoints and such on [SomeMeasure] will be applied.
[MeasureString]
Measure=String
String=[SomeMeasure]
DynamicVariables=1
Is always by its nature "asking for" the string value of that section variable, and any DecodeCodePoints and such on [SomeMeasure] will be applied.
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Yes. It worked, just made all the needed changes. Just have to remember whenever I'll edit again the skin to keep the option on the daily forecast child measure (which is the only child of the 4 that doesn't have grandchildren), as it's the last link in the chain.jsmorley wrote: ↑August 2nd, 2020, 2:34 am It should be fine passing the WebParser child value with DecodeCodePoints to a String measure.
[MeasureString]
Measure=String
String=[SomeMeasure]
DynamicVariables=1
Is always by its nature "asking for" the string value of that section variable, and any DecodeCodePoints and such on [SomeMeasure] will be applied.
All in all, great job! Many thanks for all your effort.
![Rose Gift :rosegift:](./images/smilies/ax.gif)