Yes, you certainly did. Check the new .rmskin in the first post.
It is currently September 21st, 2024, 2:55 am
⭐ Weather.com - Parsing the V3 JSON
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
-
- Posts: 39
- Joined: May 24th, 2020, 7:04 am
- Location: Switzerland
Re: ⭐ Weather.com - Parsing the V3 JSON
Yes, as usual, you nailed it.jsmorley wrote: ↑June 7th, 2020, 12:35 pm Yeah, the whole en-GB thing throws a new wrinkle into this. Before, it felt safest to use en-GB to get "metric" instead of en-US to get "imperial", as the language-based text should be pretty similar. With the new "hybrid" units of measure they use for en-GB, it might be much safer to use en-CA or en-AU or something, to get pure "metric", while having some hope that the text and phrases used will be familiar to a US English speaker.
If I switch to en-CA, both work correctly, the speeds and the pressure.
Thanks heaps.
I think maybe no problem.
-
- Posts: 78
- Joined: April 7th, 2010, 2:34 pm
Re: ⭐ Weather.com - Parsing the V3 JSON
Great I will check it out, thanks!
-
- Rainmeter Sage
- Posts: 8195
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON
Yeah, no worries - identifying the problem is no doubt the first step in solving it.
Personally, I admit not checking the regexes in jsmorley's skin, since I don't use them - shame on me.
-
- Posts: 880
- Joined: January 4th, 2018, 9:52 pm
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
I think that particular person might be using one of the older skins you haven't changed yet. Not sure.
Let me know when you get all your excellent skins fully corrected, so I can indicate that on the thread that lists them.
-
- Rainmeter Sage
- Posts: 8195
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON
By the way, just in case it is needed, a (so far) foolproof way of handling commas in the string values, without affecting other non-string ones:
You can, of course, replace the comma at the end with a more comprehensive form of the delimiter at the end of the value:
By the way, this handles the escaped quotes (i.e. \") in the string value as well (the job of converting them to literal quotes is another matter, naturally), according to the JSON specification. I'm using these patterns as variables, to simplify the code.
Again, only if you need it.
Code: Select all
(?:[^"]*|(?:(?:\\"|[^"])*"){2}),
Code: Select all
(?:,|\{|\[|\]|\}|$)
Again, only if you need it.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
We will see if we run into trouble. So far at least, it seems to handle commas in strings just fine.Yincognito wrote: ↑June 7th, 2020, 1:32 pm By the way, just in case it is needed, a (so far) foolproof way of handling commas in the string values, without affecting other non-string ones:You can, of course, replace the comma at the end with a more comprehensive form of the delimiter at the end of the value:Code: Select all
(?:[^"]*|(?:(?:\\"|[^"])*"){2}),
By the way, this handles the escaped quotes (i.e. \") in the string value as well (the job of converting them to literal quotes is another matter, naturally), according to the JSON specification. I'm using these patterns as variables, to simplify the code.Code: Select all
(?:,|\{|\[|\]|\}|$)
Again, only if you need it.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 78
- Joined: April 7th, 2010, 2:34 pm
Re: ⭐ Weather.com - Parsing the V3 JSON
Downloaded and replaced your updated templates and the conditions are fixed.
now Fair is Fair and not Partly Cloudy...
Thanks!
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
Fair enough...