Ok then.
It is currently September 20th, 2024, 8:37 pm
⭐ Weather.com - Parsing the V3 JSON
-
- Rainmeter Sage
- Posts: 8194
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Rainmeter Sage
- Posts: 2738
- Joined: March 23rd, 2015, 5:26 pm
Re: ⭐ Weather.com - Parsing the JSON
Yep it is related to that... Also, JSMorley, you may need to adjust the "trigger" measure in your example skin that detects the Day/Night change. IIRC, you were using the day name coming back blank, but the new measures always have a value now. I just used the day temperature instead as the trigger, so it is a trivial fix.
Last edited by SilverAzide on June 5th, 2020, 1:41 pm, edited 1 time in total.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the JSON
I'll just change my skin to use @ForecastTodayDayPart and @ForecastTodayNightPart as needed.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the JSON
Thanks, I'll do that.SilverAzide wrote: ↑June 5th, 2020, 1:40 pm Yep it is related to that... Also, JSMorley, you may need to adjust the "trigger" measure in your example skin that detects the Day/Night change. IIRC, you were using the day name coming back blank, but the new measures always have a value now. I just used the day temperature instead as the trigger, so it is a trivial fix.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
Ok, I have posted a new version of the .rmskin in the first post of this thread.
If you are currently using the JSON @Include .inc files for your weather skin, and they are not working suddenly, just replace the files:
WeatherComJSONMeasures.inc
WeatherComJSONMoon.inc
WeatherComJSONAlerts.inc
In your @Resources folder with the new versions, refresh your skin, and it should start working again.
If you are currently using the JSON @Include .inc files for your weather skin, and they are not working suddenly, just replace the files:
WeatherComJSONMeasures.inc
WeatherComJSONMoon.inc
WeatherComJSONAlerts.inc
In your @Resources folder with the new versions, refresh your skin, and it should start working again.
-
- Posts: 62
- Joined: March 30th, 2016, 5:02 pm
Re: ⭐ Weather.com - Parsing the V3 JSON
Bingo - worked first time. Thanks to all who helped.
-
- Rainmeter Sage
- Posts: 8194
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON
Yep, it works very well - good job for all those involved. Me, I just checked and got the new page design as well (the magenta based one) for the main page, a much bigger size of the page source (the V2 was around 400 Kb, the V3 was around 1MB at the beginning but it's now around 2MB), but overall apparently no changes in the format from when I first saved the page sources.jsmorley wrote: ↑June 5th, 2020, 2:36 pm Ok, I have posted a new version of the .rmskin in the first post of this thread.
If you are currently using the JSON @Include .inc files for your weather skin, and they are not working suddenly, just replace the files:
WeatherComJSONMeasures.inc
WeatherComJSONMoon.inc
WeatherComJSONAlerts.inc
In your @Resources folder with the new versions, refresh your skin, and it should start working again.
There are some interesting (and significant, in terms of content) changes in the source when using a different language. I used to set the language to en-GB to force the metric system, but apparently this is no longer necessary (hopefully, it will last), and the unit info is right at the start of the JSON part as well, in the twc-unit field from headers (now that is the correct m for me, as in the early stages of V3 it was u - probably from 'unknown' - although the URL parameters were the same). The format and structure of the narrative field is different between en-US and en-GB (that was not necessarily expected), with the UK style more condensed, less commas, shorter phrases, etc. Thankfully, I don't use the narrative, so I won't have to deal with the missing degree sign (i.e. 16C instead of 16°C) and the overall more expansive / chaotic /informal US style compared to the UK one ... but something that I did use was the short phrase, and that is present only in the en-US version (along with the medium phrase, in the observation area) and not in the en-GB version, I guess to compensate the fact that the UK style is much more compact in the narrative area.
Lastly, I believe some fields will suffer other modifications in the future, as I noticed some are present twice (i.e. temperatureMin / temperatureMax from the base forecast vs temperature from the daypart forecast, which are the same), so they might be removed at one point or another.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
The units fall into 3 types. "e", which is Imperial, fahrenheit, inches, all that, "m", which is purely Metric, celsius, millibars, etc. and "h", which is the "hybrid" form used in the UK (en-GB) which uses metric for everything except wind speed and visibility distance, which is in mph and mi instead of km/h and km.
OnyxBlack came up with a very nice approach for dealing with those.
OnyxBlack came up with a very nice approach for dealing with those.
-
- Rainmeter Sage
- Posts: 8194
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON
I'm sure he did - he saved you some time with the whole rewriting the thing, kudos to him.jsmorley wrote: ↑June 5th, 2020, 5:33 pm The units fall into 3 types. "e", which is Imperial, fahrenheit, miles, all that, "m", which is purely Metric, celsius, millibars, etc. and "h", which is the "hybrid" form used in the UK (en-GB) which uses metric for everything except wind speed, which is in mph instead of km/h.
OnyxBlack came up with a very nice approach for dealing with those.
I know about the unit differences (I too posted the same info eariler in this thread, if I'm not mistaken ), I just noticed that now the site seems to "auto-detect" the system probably based on location, even if you don't specifically set the language. Not sure if it's permanent or just my impression, but it would be nice to be like that on a consistent basis. I mentioned the changes in the page source regarding that just for reference, because in the end, it's just 3 countries using the imperial system (US, Myanmar and Liberia) and the hybrid system doesn't seem to be used even in the case of setting the language to en-GB, so the whole unit system setting can be done entirely locally, without even bothering extracting it from the source.
-
- Developer
- Posts: 22749
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON
Huh. I get "h" for the units when I set en-GB as the language.
You do not have the required permissions to view the files attached to this post.