It is currently April 20th, 2024, 5:06 am

⭐ Weather.com - Parsing the V3 JSON

Our most popular Tips and Tricks from the Rainmeter Team and others
OnyxBlack
Posts: 27
Joined: June 3rd, 2020, 10:06 am

Re: ⭐ Weather.com - Parsing the JSON

Post by OnyxBlack »

jsmorley wrote: June 5th, 2020, 12:25 pm The more the merrier really. I see that you have done some good work already on parsing the new V3 version of the JSON. I haven't looked at the new stuff really carefully yet, but it looks to me like there might be some new information that wasn't part of the old method. I want to be sure that as much as possible, we get everything that is available into a measure, so what is used and not used is up to the skin author.

I may well steal some of your RegExp as I work on this, I'll be sure to credit you when I do.
Go to town, take what you need, copy wholesale, whatever, as long as there's a nice set of working measures people can use (like you've done already). I just provided mine as a shiv for people stuck without working measures (like I was). Better there be a single file everyone can download and work with, so once yours are up I'll make sure to delete mine.
Maybe take the opportunity to make everythig slightly more consistent (like I suggested on page 23), for example in the forecast you call them "today", "day2", "day3", whereas with your moon measures you call it "day1", "day2" etc., which makes more sense.
jsmorley wrote:This is the starting point for what I am looking at. These seem to be the relevant sections of the JSON.
I only utilized "getSunV3LocationPointUrlConfig", "getSunV3CurrentObservationsUrlConfig" and "getSunV3DailyForecastUrlConfig". Personally, I think air quality and pollen are overkill and hardly worth the effort. If you're striving for coverage, I'd prioritise hourly forecasts, those seem more useful.
As for Moon data, I included an updated V3 moon file in the zip on page 23, so maybe you can use that as a starting point (in fact its complete compared to your original moon measures).
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 »

OnyxBlack wrote: June 5th, 2020, 12:41 pm Go to town, take what you need, copy wholesale, whatever, as long as there's a nice set of working measures people can use (like you've done already). I just provided mine as a shiv for people stuck without working measures (like I was). Better there be a single file everyone can download and work with, so once yours are up I'll make sure to delete mine.
Maybe take the opportunity to make everythig slightly more consistent (like I suggested on page 23), for example in the forecast you call them "today", "day2", "day3", whereas with your moon measures you call it "day1", "day2" etc., which makes more sense.


I only utilized "getSunV3LocationPointUrlConfig", "getSunV3CurrentObservationsUrlConfig" and "getSunV3DailyForecastUrlConfig". Personally, I think air quality and pollen are overkill and hardly worth the effort. If you're striving for coverage, I'd prioritise hourly forecasts, those seem more useful.
As for Moon data, I included an updated V3 moon file in the zip on page 23, so maybe you can use that as a starting point (in fact its complete compared to your original moon measures).
Yeah, I will start with "getSunV3LocationPointUrlConfig", "getSunV3CurrentObservationsUrlConfig" and "getSunV3DailyForecastUrlConfig" as well, as the rest of it, Hourly/Pollen/Quality/Moon/Skiing/Tides and all that are not things that 90% of skin authors will ever need. I'd like to do this as a "drop in" replacement for the current @Include files, to reduce or even eliminate the need to change the skins, but I'm not sure yet that I can do that without making a mash of this. The way the daily forecast stuff is done is a lot different between the two versions.

I have never understood why anyone other than Lon Chaney would care what phase of the moon it is... ;-)
OnyxBlack
Posts: 27
Joined: June 3rd, 2020, 10:06 am

Re: ⭐ Weather.com - Parsing the JSON

Post by OnyxBlack »

jsmorley wrote: June 5th, 2020, 12:47 pm I'd like to do this as a "drop in" replacement for the current @Include files, to reduce or even eliminate the need to change the skins, but I'm not sure yet that I can do that without making a mash of this.
Frankly I wouldn't worry overmuch. Skin authors (and most importantly their users) are more and more likely looking at bricked skins right now anyway, so an update is mandatory. If the skin author has to rename the value on one or two "measure=" fields, that shouldn't be too taxing. I managed, and I'm just dabbling with rainmeter.
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 »

OnyxBlack wrote: June 5th, 2020, 12:59 pm Frankly I wouldn't worry overmuch. Skin authors (and most importantly their users) are more and more likely looking at bricked skins right now anyway, so an update is mandatory. If the skin author has to rename the value on one or two "measure=" fields, that shouldn't be too taxing. I managed, and I'm just dabbling with rainmeter.
I'm looking at your WeatherComJSONMeasures.inc, and I think that might be what we need. I might be re-inventing the wheel to mess with it too much.

If you are happy with how it works, how about if I just incorporate that into the .rmskin in the first post of this thread, make sure I update any documentation, and we call it a day?
OnyxBlack
Posts: 27
Joined: June 3rd, 2020, 10:06 am

Re: ⭐ Weather.com - Parsing the JSON

Post by OnyxBlack »

jsmorley wrote: June 5th, 2020, 1:03 pm If you are happy with how it works, how about if I just incorporate that into the .rmskin in the first post of this thread, make sure I update any documentation, and we call it a day?
As I said, I'm completely fine with that, if it lives up to your expectations. That said, SilverAzide has pointed out two minor bugs further up this thread that I haven't fixed yet, so maybe you can take care of that while you're at it.
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 »

OnyxBlack wrote: June 5th, 2020, 1:06 pm As I said, I'm completely fine with that, if it lives up to your expectations. That said, SilverAzide has pointed out two minor bugs further up this thread that I haven't fixed yet, so maybe you can take care of that while you're at it.
Can you link to that post?
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 »

Never mind, I see it. I'll make those changes before I post.
qsdfghjklmtoc
Posts: 2
Joined: June 5th, 2020, 1:10 pm

Re: ⭐ Weather.com - Parsing the JSON

Post by qsdfghjklmtoc »

I don't understand, when I look at the informations, all mesures are empty.

There are these errrors :
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentSunriseTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentObservationTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentSunsetTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentObservationDate])

Why should I do ?
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 »

qsdfghjklmtoc wrote: June 5th, 2020, 1:16 pm I don't understand, when I look at the informations, all mesures are empty.

There are these errrors :
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentSunriseTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentObservationTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentSunsetTime])
Invalid TimeStampFormat: %Y-%m-%dT%H:%M:%S (WeatherComJSON\WeatherComJSON.ini - [@CurrentObservationDate])

Why should I do ?
You need to wait a couple / few hours and I will be posting an entirely new set of measures and a new .rmskin / example in the first post of this thread. You should be able to drop the new .inc files in the @Resources folder of your skin, refresh, and it should work. Stand by...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: ⭐ Weather.com - Parsing the JSON

Post by SilverAzide »

jsmorley wrote: June 5th, 2020, 1:15 pm Never mind, I see it. I'll make those changes before I post.
Howdy... sent you a PM with all fixes incorporated. Just FYI. :)
Gadgets Wiki GitHub More Gadgets...