It is currently September 20th, 2021, 12:00 am

⭐ Weather.com - Parsing the V3 JSON - NEW!

Our most popular Tips and Tricks from the Rainmeter Team and others
1for-matik
Posts: 1
Joined: June 17th, 2020, 1:44 am

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by 1for-matik »

Hello jsmorley,

There's a typo in the @ForecastDay4DayOfMonth part of the WeatherComJSONMeasure.inc (and the others) which returns the Day3 Of the month. 😉
User avatar
jsmorley
Developer
Posts: 22284
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

1for-matik wrote: June 17th, 2020, 1:49 am Hello jsmorley,

There's a typo in the @ForecastDay4DayOfMonth part of the WeatherComJSONMeasure.inc (and the others) which returns the Day3 Of the month. 😉
Fixed. Thanks a ton for catching that.
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by SCR »

jsmorley wrote: June 17th, 2020, 1:36 am Edit June 16, 2020 - Created different versions of WeatherComJSONMeasures.inc based on the number of days you want to forecast.
Thank you, and everyone else involved in this effort, I really appreciate your hard work in making it possible for me to use my weather skin. I really like the reduced number of days include files as I only forecast for 5 days.

Your foresight and advice early on to make a separate measure.inc file for any changes to the base measures has been a real work saver.

I am going to attempt to fix the former working WeatherComJSONPollen.inc file. However I have my doubts as to my success considering my woefully inadequate skills. If I do get it working I'll let you know. Don't hold your breath. :D

Thanks again, I know this was a ton of work on your part to make it easy for me. I truly appreciate it.
User avatar
jsmorley
Developer
Posts: 22284
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

SCR wrote: June 17th, 2020, 11:58 am Thank you, and everyone else involved in this effort, I really appreciate your hard work in making it possible for me to use my weather skin. I really like the reduced number of days include files as I only forecast for 5 days.

Your foresight and advice early on to make a separate measure.inc file for any changes to the base measures has been a real work saver.

I am going to attempt to fix the former working WeatherComJSONPollen.inc file. However I have my doubts as to my success considering my woefully inadequate skills. If I do get it working I'll let you know. Don't hold your breath. :D

Thanks again, I know this was a ton of work on your part to make it easy for me. I truly appreciate it.
Yeah, It is my intent to do new versions for Moon, Pollen, and maybe AirQuality and Tides as soon as I catch my breath.
User avatar
gt57
Posts: 13
Joined: August 31st, 2009, 4:02 am

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by gt57 »

Forecast___DayLong and Forecast___Dayshort can produce different results. Not sure if this is the intended functionality.

My local date and time: 6/17/2020 8:00 AM EDT (UTC -4)
Measuring weather in Lihue, HI local date and time 6/16/2020 2:00 AM (UTC -10)
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22284
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

gt57 wrote: June 17th, 2020, 12:45 pm Forecast___DayLong and Forecast___Dayshort can produce different results. Not sure if this is the intended functionality.

My local date and time: 6/17/2020 8:00 AM EDT (UTC -4)
Measuring weather in Lihue, HI local date and time 6/16/2020 2:00 AM (UTC -10)
Yes, this is a quirk of the time that weather.com switches from "night" to "day" in the early morning. This will normally only be an issue for an hour or two after "midnight" in the location you are using. I'm not sure we have yet found a good way to address this. It's because we get the "long" day, like "Monday" directly from the data, but extrapolate the "short" day, like "Mon" by using a Time measure to evaluate the "Observation Date/Time" timestamp, and adding 1,2,3 etc. days (in seconds) to it. For an hour or two in the morning, these don't sync up.

We have discussed this in the past, but I don't see a good, or at least reasonably easy, other way to get "Mon" from "Monday". Sure, you can just abbreviate the English variant, but that's not going to work with all languages. I'm still chewing on it...
User avatar
jsmorley
Developer
Posts: 22284
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

Edit June 17, 2020 - Ok I think I might have fixed that issue with the "long day name" and the "short day name" (and other day month values) getting out of sync for an hour or two early in the morning.

Get the .rmskin in the first post of this thread.


I'm not forcing a days worth of seconds (86400) times the number of days from "today" anymore. That approach was based on the "observation time", and at some points in the day that could get out of sync with the long name of the day being returned as a string. I'm now using a field "validTimeLocal" that is returned for each day, and I'm pretty sure, or at least hoping, that this solves the issue.
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by SCR »

jsmorley wrote: June 17th, 2020, 12:07 pm Yeah, It is my intent to do new versions for Moon, Pollen, and maybe AirQuality and Tides as soon as I catch my breath.
Wow, well OK then. :jawdrop That is very kind of you.

I can wait. Absolutely no rush at all. Please take your time. In the mean time I need to create some more screen real estate to accommodate then new data measures.

It would probably take about 3 to 4 months for me to come to the conclusion that the Pollen.inc is just something I can't figure out which doesn't mean I would give up, I never give up, but I'm sure my frustration level would be pretty high. :headbang:

By the way I dropped the new WeatherComJSONMeasures5Day.inc file in my weather skin and change the include name, it worked perfectly. 8-)

Thank you.
User avatar
jsmorley
Developer
Posts: 22284
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by jsmorley »

SCR wrote: June 17th, 2020, 3:09 pm Wow, well OK then. :jawdrop That is very kind of you.

I can wait. Absolutely no rush at all. Please take your time. In the mean time I need to create some more screen real estate to accommodate then new data measures.

It would probably take about 3 to 4 months for me to come to the conclusion that the Pollen.inc is just something I can't figure out which doesn't mean I would give up, I never give up, but I'm sure my frustration level would be pretty high. :headbang:

By the way I dropped the new WeatherComJSONMeasures5Day.inc file in my weather skin and change the include name, it worked perfectly. 8-)

Thank you.
Glad to do it.

Pollen is actually not too tough, as it is a static set of values for each day. Air Quality / Pollutants I'm not looking forward to, as that is a dynamic number of entries per day, from zero to infinite, much like Alerts are.
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: ⭐ Weather.com - Parsing the V3 JSON

Post by SCR »

jsmorley wrote: June 17th, 2020, 3:15 pm Glad to do it.

Pollen is actually not too tough, as it is a static set of values for each day. Air Quality / Pollutants I'm not looking forward to, as that is a dynamic number of entries per day, from zero to infinite, much like Alerts are.
Easy for you to say..."Not too tough" .. but for me it's monumental. I eventually managed to figure out .xml, just in time for it to go away. But the stuff you do, let's just say if a alien landed on earth and handed me a book in their language I would have a better shot at figuring that out.

I haven't had an alert here in days it's just hotter then the hinges of H... and no rain, so I'm not sure if mine is working. I use the [MeasureAlerts] in your Weather.com skin with some of my own modifications. Time will tell.