It is currently April 16th, 2024, 10:32 am

⭐ Weather.com - Parsing the V3 JSON

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ weather.com - Parsing the JSON

Post by Yincognito »

jsmorley wrote: May 21st, 2020, 6:55 pm Try restarting Rainmeter. Nothing has changed.
Actually, I've experienced the same thing, but I was busy with other things at the time and didn't notice. Now however...
Notice the absence of quotes enclosing the name of the fields / sections. Hopefully, this is all that has changed, but I'm not sure yet. (<-- my bad, this was due to the stupid "upgraded" HTML formatter - why the heck do they need to "upgrade" a perfectly working thing?)

My weather skin isn't picking anything either, although the source page seems to be relatively similar.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ weather.com - Parsing the JSON

Post by jsmorley »

Yincognito wrote: May 21st, 2020, 7:37 pm Actually, I've experienced the same thing, but I was busy with other things at the time and didn't notice. Now however...
Notice the absence of quotes enclosing the name of the fields / sections. Hopefully, this is all that has changed, but I'm not sure yet. (<-- my bad, this was due to the stupid "upgraded" HTML formatter - why the heck do they need to "upgrade" a perfectly working thing?)

My weather skin isn't picking anything either, although the source page seems to be relatively similar.
I can't even make any observation if someone is not using the exact, most recent, version of the JSON parsing include files that are included with the skin in the first post of this thread. I have no interest whatsoever in any issues with HTML parsers, or any skin that isn't using my JSON include files.

Any discussion of any other method of parsing the site is just entirely off topic, and should be in its own thread.

For me at least, it's working just fine right now, and has been all day. I can't provide any insight to anyone having an issue, perhaps on some "regional" basis for the site, since it just works as expected for me.
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ weather.com - Parsing the JSON

Post by Yincognito »

jsmorley wrote: May 21st, 2020, 8:36 pm I can't even make any observation if someone is not using the exact, most recent, version of the JSON parsing include files that are included with the skin in the first post of this thread. I have no interest whatsoever in any issues with HTML parsers, or any skin that isn't using my JSON include files.

Any discussion of any other method of parsing the site is just entirely off topic, and should be in its own thread.

For me at least, it's working just fine right now, and has been all day. I can't provide any insight to anyone having an issue, perhaps on some "regional" basis for the site, since it just works as expected for me.
Fair enough. I can check it all by myself using automated file comparison, no worries.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ weather.com - Parsing the JSON

Post by Yincognito »

jsmorley wrote: May 21st, 2020, 8:36 pmI can't even make any observation if someone is not using the exact, most recent, version of the JSON parsing include files that are included with the skin in the first post of this thread. I have no interest whatsoever in any issues with HTML parsers, or any skin that isn't using my JSON include files.

Any discussion of any other method of parsing the site is just entirely off topic, and should be in its own thread.
So, this is the exact, most recent, version of the JSON parsing include files that are included with the skin in the first post of this thread, i.e. your JSON include files :sly: :
WeatherComJSON.jpg
jsmorley wrote: May 21st, 2020, 8:36 pmFor me at least, it's working just fine right now, and has been all day. I can't provide any insight to anyone having an issue, perhaps on some "regional" basis for the site, since it just works as expected for me.
Yep, so this must be a "regional" issue then. The "center" is fine, as always, it's them "outskirts" causing the troubles obviously. Nobody cares about the ghetto life, the thug life anymore... :-(

Joking aside, it could be a temporary issue, maybe waiting a couple of hours or till the next day might "magically" clear this issue. ;-)

Note: The "off topic" regexes seems to work fine in an online tester where I copy paste the original source page. The file comparison process didn't yield any real difference either and the WebParser parents (both the "on" and the "off" topic) don't get any data (even when setting RegExp=^(.*)$), so it might be a permission issue. Hopefully it's IP / regionally based and not Rainmeter based.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ weather.com - Parsing the JSON

Post by jsmorley »

You might try opening WeatherComJSONMeasures.inc and adding a UserAgent string to the master parent measure:

Code: Select all

[@EntireSiteSuperParent]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
DecodeCharacterReference=1
UpdateRate=#UpdateRate#
LogSubstringErrors=0
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!EnableMeasureGroup Parents]
;Debug=2
;Debug2File=#@#EntireSite.txt
iron2000
Posts: 15
Joined: June 6th, 2011, 3:47 am

Re: ⭐ weather.com - Parsing the JSON

Post by iron2000 »

jsmorley wrote: May 21st, 2020, 11:13 pm You might try opening WeatherComJSONMeasures.inc and adding a UserAgent string to the master parent measure:

Code: Select all

[@EntireSiteSuperParent]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
DecodeCharacterReference=1
UpdateRate=#UpdateRate#
LogSubstringErrors=0
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!EnableMeasureGroup Parents]
;Debug=2
;Debug2File=#@#EntireSite.txt
Adding UserAgent doesn't work.
User avatar
nbtc971
Posts: 13
Joined: May 22nd, 2020, 6:10 am

Re: ⭐ weather.com - Parsing the JSON

Post by nbtc971 »

Yeah, weather isn't loading for me either.
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ weather.com - Parsing the JSON

Post by Yincognito »

Yep, just turned on my computer today and still no data received in the weather's WebParser. Just tried using various UserAgent strings and it didn't work, but I also tried downloading the file using Debug=2 option and it did download the page source (which can be then parsed).

I don't recommend using the aforementioned "workaround" just yet, maybe someone comes up with a more convenient alternative in the meantime. The "good news" is that there is a workaround for this, albeit a bit inconvenient.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
xenium
Posts: 857
Joined: January 4th, 2018, 9:52 pm

Re: ⭐ weather.com - Parsing the JSON

Post by xenium »

It works for me.
But WeatherComCodes doesn't work.
I need to manually edit the WeatherComJSONVariables.inc file
Capture.PNG
Capture2.PNG
Edit:
My skins that use the HTML version work for me.
But for other users they don't work, although their locations work for me
I don't know what could be causing this issue
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ weather.com - Parsing the JSON

Post by Yincognito »

xenium wrote: May 22nd, 2020, 8:38 am It works for me.
But WeatherComCodes doesn't work.
I need to manually edit the WeatherComJSONVariables.inc file
Capture.PNG
Capture2.PNG

Edit:
My skins that use the HTML version work for me.
But for other users they don't work, although their locations work for me
I don't know what could be causing this issue
Yeah, found a way to get all the data, just having trouble processing it further (the same regexp error). Will explore some workarounds to handle this.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth