It is currently September 21st, 2024, 12:24 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: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by Yincognito »

jsmorley wrote: June 7th, 2020, 7:29 pm Yeah, maybe I don't fully understand, but I have never noticed a problem. Of course I NEVER use either the long or the short name for the current day, as when it is Saturday, that is "Today / Tonight" for me, and never "Saturday / Sat" as that just feels weird to me. I'm less anal about "Tomorrow", as I'm fine with either "Tomorrow" or "Sunday" for that.
No, I meant the fact that there is a delay / jump from / to the next day around 3 AM. I noticed that a long time ago.
Regarding the day names, if I correctly understand the issue raised by SilverAzide, that's just a consequence of the aforementioned day delay / jump in the middle of the night. Me, I'm using only day abbreviations, never tomorrows and such, but as I said, that wasn't necessarily what I was referring to, just the delay / jump part. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2738
Joined: March 23rd, 2015, 5:26 pm

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by SilverAzide »

jsmorley wrote: June 7th, 2020, 7:40 pm Just as an aside, it just changed from "today" to "tonight" for me, about 3:15pm or 3:30pm or so my time. I'm pretty ok with that, as I would postulate that a "forecast" for "today" becomes less relevant about that time, and the forecast for "tonight" becomes more interesting. I guess any decisions you are going to make based on today's weather have already been made by then.
Yes! If you point your weather skin at someplace like Vietnam or where ever it is coming up on 3AM, you'll be able to watch the transition from "tonight" to "today". The About screen will show the mismatches in day names (the short day name will be ahead of the long day name).
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

Yincognito wrote: June 7th, 2020, 7:42 pm No, I meant the fact that there is a delay / jump from / to the next day around 3 AM. I noticed that a long time ago.
Regarding the day names, if I correctly understand the issue raised by SilverAzide, that's just a consequence of the aforementioned day delay / jump in the middle of the night. Me, I'm using only day abbreviations, never tomorrows and such, but as I said, that wasn't necessarily what I was referring to, just the delay / jump part. ;-)
Well, I must just be stupid today, but I don't see how subtracting 3 or 4 hours from the timestamp helps at all EXCEPT during that narrow window of time, as soon as the site DOES have the correct day, you are likely to see "yesterday" for at least some period of time. This feels very Rube Goldberg to me.
User avatar
Yincognito
Rainmeter Sage
Posts: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by Yincognito »

jsmorley wrote: June 7th, 2020, 7:48 pm Well, I must just be stupid today, but I don't see how subtracting 3 or 4 hours from the timestamp helps at all EXCEPT during that narrow window of time, as soon as the site DOES have the correct day, you are likely to see "yesterday" for at least some period of time. This feels very Rube Goldberg to me.
Yeah, I wasn't the one mentioning that subtraction, but SilverAzide - you'd have to ask him about it. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

SilverAzide wrote: June 7th, 2020, 7:48 pm Yes! If you point your weather skin at someplace like Vietnam or where ever it is coming up on 3AM, you'll be able to watch the transition from "tonight" to "today". The About screen will show the mismatches in day names (the short day name will be ahead of the long day name).
Hm.. Yeah. If I change to A Lu, Vietnam, I get this, and it is still "tonight" there.


1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

I'm not sure I'm in love with any solution for this. The "cleanest" seems to me to build a series of Substitute statements in the language variables file and use that to change "Sunday" into "Sun", but ick. That is going to take some doing for all the languages out there.
User avatar
Yincognito
Rainmeter Sage
Posts: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by Yincognito »

How about the date itself? Because for the defunct wxdata (same source, after all), that was offset as well, for like 2-3 hours in the late night / early morning...

P.S. I ask this because if the date is correct, then the day of week name can be adjusted based on that. Right?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2738
Joined: March 23rd, 2015, 5:26 pm

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by SilverAzide »

Yep... as soon as be flips to being "today", everything will sync up.

Here's the tweak for anyone who cares....
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

Yincognito wrote: June 7th, 2020, 7:57 pm How about the date itself? Because for the defunct wxdata (same source, after all), that was offset as well, for like 2-3 hours in the late night / early morning...
In my A Lu, Vietnam example, it looks like this:



1.jpg


It is more or less 4am there, and the date and long name are correct.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

Feels to me that the problem is not with the "short" day name based on the Observation timestamp, that is correct. It is the "long" day name, which is passed as-is in the data. But if we start replacing that with a calculation, then we presumably have to do that with a lot of things, including the "part" data, like "Today" and "Tonight".

I mean technically I guess 3am is "tonight", but not really in my view. It's "today" or at least "This morning"... ;-)

Obviously weather.com doesn't see it that way, as you are still getting "nighttime" weather at 3am.