Yeah, this might be a short-term problem.Yincognito wrote: ↑July 29th, 2020, 5:24 pm Yeah, just wondering why I got mails about non existing posts, LOL. Good idea, to keep it centralized.
And yes, they are just escaping quotes. Switched on my API version in the meantime, and it all works well there, no escaped quotes, so I'm guessing the quote escaping is not yet consistent or stable, thus I'll be patient for the time being.
It is currently September 8th, 2024, 2:28 am
Weather Skins Not Working
-
- Developer
- Posts: 22715
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
-
- Posts: 28
- Joined: December 3rd, 2018, 1:15 am
-
- Developer
- Posts: 22715
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
Yeah, that does seem to work, but crap, that's a lot of changes.
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Yeah, the thing is they are escaping the field names as well, not just the field values, which is why your substitutions might not work. Didn't look into this in detail - as in my view, unless they're trying to make all the JSON part a huge string (in JSON string values, quotes are indeed escaped), this quote escaping doesn't make much sense -, so it's just a wild guess.
-
- Developer
- Posts: 22715
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
Yeah, I'm tempted to wait 24 hours before I make the boatload of changes this would require.Yincognito wrote: ↑July 29th, 2020, 5:45 pm Yeah, the thing is they are escaping the field names as well, not just the field values, which is why your substitutions might not work. Didn't look into this in detail - as in my view, unless they're trying to make all the JSON part a huge string (in JSON string values, quotes are indeed escaped), this quote escaping doesn't make much sense -, so it's just a wild guess.
I think just replacing " with \\" in all RegExp options should work in theory, since both the field names and string values were and are enclosed in quotes already.
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Yep, just figured out why this happens. The start of the <script> element in the HTML now looks like this:
<script>window.__data=JSON.parse(...
In other words, it looks like they are indeed trying to turn everything into a long string, hence the escaped quotes.
I guess the reason why the API version doesn't suffer from this drawback is because it is already a JSON file per se.
<script>window.__data=JSON.parse(...
In other words, it looks like they are indeed trying to turn everything into a long string, hence the escaped quotes.
I guess the reason why the API version doesn't suffer from this drawback is because it is already a JSON file per se.
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working
Hypothetically, this could have been solved in a heartbeat if only the Substitutions made in WebParser measures (i.e. the parents) would have been propagated to the children, through the StringIndexes. If that was the case (which is not, obviously), as simple replacement of \" with " in the superparent would have been enough, as every child or grandchild of it would have received the modified result.
Last edited by Yincognito on July 29th, 2020, 6:06 pm, edited 1 time in total.
-
- Developer
- Posts: 22715
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
So it seems like two steps are needed.
1) Replace all " with \\" in all RegExp options in the various WeatherComJSONMeasures*.inc files.
2) Add ,"\\":"" to the end of #CommonSubstitute# in the WeatherComJSONVariables.inc file.
And bingo...
1) Replace all " with \\" in all RegExp options in the various WeatherComJSONMeasures*.inc files.
2) Add ,"\\":"" to the end of #CommonSubstitute# in the WeatherComJSONVariables.inc file.
And bingo...
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22715
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working
I agree, and that occurred to me first thing, but it really can't work that way. Substitute does not "change" the value of a measure, but only the string value that is obtained when some other measure "asks for" the string value of the measure. Child measures are not using the string value of the parent measure, and in fact don't "ask for" any value at all. The child measures values are automatically populated by WebParser itself as a part of the plugin functionality.Yincognito wrote: ↑July 29th, 2020, 6:05 pm Hypothetically, this could have been solved in a heartbeat if only the Substitutions made in WebParser measures (i.e. the parents) would have been propagated to the children, through the StringIndexes. If that was the case (which is not, obviously), as simple replacement of \" with " in the superparent would have been enough, as every child or grandchild of it would have received the modified result.
The other issue is that the entire weather.com site is ginormous, and using RegExpSubstitute on the entire value pretty much brings Rainmeter to its knees...
-
- Posts: 442
- Joined: July 30th, 2014, 10:30 am
Re: Weather Skins Not Working
It fixed the issue. Thanks Morley!
![Rose Gift :rosegift:](./images/smilies/ax.gif)