It is currently October 7th, 2022, 8:38 am

⭐ Weather.com

Weather skins
User avatar
QuakeGuy
Posts: 31
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: ⭐ Weather.com

Post by QuakeGuy »

I also get the JSON V2 version on a rare basis since yesterday. Let's hope this issue settles the next days.
User avatar
Yincognito
Rainmeter Sage
Posts: 4806
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com

Post by Yincognito »

jsmorley wrote: June 10th, 2020, 12:53 pm I'm hesitant to jump to an approach that is that complicated. While it might work just fine, and for 90% of users they are never going to look at how the sausage is made anyway, I do fear that if there is some minor change to the JSON, one that breaks both my stuff and yours, a much more complicated RegExp is going to be really hard for anyone but the most determined person to fix.

In any case, I refuse to accept that they are going to continue to maintain both V2 and V3 going forward. My guess is that this is an IBM Company, running on the IBM Cloud, and they are having some issues with how they are "balancing" between servers as they roll out the final (for now) V3 version of this. It's fine for me today, and hopefully will continue to be so.
Well, 90% of it isn't complicated at all, really - it's actually very simple. My focus was to create the regexes using minimal data, and I'm sure that you have an idea just how minimal is minimal to me, knowing how my suite looks like. :lol: As for breaking stuff, my approach, while not impossible to, is going to be very hard to break up, as the only way of doing that is either name the fields in a completely different way or if the number of nested subsections is going to be dramatically changed (quite unlikely, this one). Even so, the modifications required if such a thing happens are again ... minimal, mainly changing the "root" name of the field (I mean, how many ways you can call "temperature" in English, right?) or changing the number of brackets used to anchor the regex patterns in the quantifiers (i.e. {2} instead of {1} and such).

Only the daily forecast regex is a bit more complicated, but not by much if you understand what each part represents. It's just one regex though, used in all the daily forecast fields, and as always, things are controlled just by changing the regex quantifiers accordingly, nothing else needed.
jsmorley wrote: June 10th, 2020, 12:53 pmWhat would be nice at some point, is something, probably a plugin, that could take a dump of the site from WebParser, and extract just the JSON from it, formatting it into a text file with all the line breaks and indenting and all that, so it becomes MUCH more readable. Then use some JSON "reader" functionality to get fields by name, so it wouldn't matter about any "order" or other extraneous "formatting" in the original source. I guess my point is that this is JSON, although embedded in HTML in a weird and ugly way, and JSON is JSON. "Parsing" JSON like any other text file sorta defeats the purpose.
Yeah, a JSON parser plugin supported by the Rainmeter team would be nice, indeed. The thing is, even with a JSON parser plugin, you'd still have to use regex for changing field names. You can do a dailyforecast.data.daypart.temperature[5] (just an example) to get the temperature for the 3rd day's daytime, but if the root section is changed into daily_forecast, you'd still have to use regex to handle that. Even so, if the version fluctuates between V2 and V3 and the whole structure / field names change, an already set (i.e. hardcoded) JSON query in the JSON parser won't be of much help, but regex will, as it's much more flexible.

That being said, one can get only the JSON (i.e. without the site or the HTML), and only a specific version of it (V1, V2 or V3 as desired) easily - so a stable way to get the data, but that involves dealing with an API key, and as already discussed, we agreed we should avoid that, at least as long as another method is still usable. I made my approach to work in those circumstances as well, and even though I'm not using it, it's good to know it's there if things go seriously south.

P.S. I can share the details of my approach with you in private, if you want, and then it will be up to you to decide if it's too complicated, if it has any drawbacks, or anything else you might feel it's "shaky". Me, I don't believe it has many flaws (if any), but then, this is not just about me, in the end...
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com

Post by jsmorley »

Like I said, I refuse to believe that they intend to deliver two entirely incompatible JSON formats to users on a random and arbitrary basis going forward. Time will tell I guess. I just don't see the burning need to have a parser that is capable of reacting to V2 or V3 seamlessly, when what is more likely is that sometime in the not-too-distant future there will be a V4 that we have to deal with. I want to have an approach that makes it as simple as possible to change the RegExp, and create @Include .inc files that can just be "dropped in" to fix any number of skins without having to manhandle each of them individually.
User avatar
Yincognito
Rainmeter Sage
Posts: 4806
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com

Post by Yincognito »

jsmorley wrote: June 10th, 2020, 1:49 pm Like I said, I refuse to believe that they intend to deliver two entirely incompatible JSON formats to users on a random and arbitrary basis going forward. Time will tell I guess. I just don't see the burning need to have a parser that is capable of reacting to V2 or V3 seamlessly, when what is more likely is that sometime in the not-too-distant future there will be a V4 that we have to deal with. I want to have an approach that makes it as simple as possible to change the RegExp, and create @Include .inc files that can just be "dropped in" to fix any number of skins without having to manhandle each of them individually.
As you wish. :confused: I'm not trying to force my approach on anyone, just trying to help, if possible. Weather.com switching from V2 to V3 or viceversa when delivering stuff has nothing to do with anyone's refusal to believe such a scenario is possible or not, since, as explained in another thread, this doesn't cost them anything, their Javascript engine will read either. They could deliver V1 (exaggerating a bit for the sake of the argument) for all I care and not have any problems with it, unlike us "scrapers", LOL.

P.S. A V4 is already available, it's just that it's used for other stuff on their site. I'm not even sure weather data can be queried using V4 at the moment. Also, just to clarify in case it wasn't properly understood, my method is fully compatible with your @Include .inc files approach, bar some minor adaptation work. Not sure why you have the impression that everything I do must be overly complicated, by the way. :rofl:
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Weather.com

Post by jsmorley »

Well, my refusal to believe that they would not randomly and in an arbitrary way deliver two different versions of the JSON is unshakable. I could see them "deprecating" V2, and having a way to "ask for it", if you had an older system that was using the old format and wanted to stay with it. I can't see just a roll of the dice on this, that just doesn't make sense.

In any case, I guess we can cross that bridge when we come to it. I have not seen any sign of V2 for at least a week, and if it was something that was really happening, the forums would be flooded (again) with "Whaaa! My weather skin stopped working!" posts, I'm not seeing that.
User avatar
Yincognito
Rainmeter Sage
Posts: 4806
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ⭐ Weather.com

Post by Yincognito »

jsmorley wrote: June 10th, 2020, 2:24 pm Well, my refusal to believe that they would not randomly and in an arbitrary way deliver two different versions of the JSON is unshakable. I could see them "deprecating" V2, and having a way to "ask for it", if you had an older system that was using the old format and wanted to stay with it. I can't see just a roll of the dice on this, that just doesn't make sense.

In any case, I guess we can cross that bridge when we come to it. I have not seen any sign of V2 for at least a week, and if it was something that was really happening, the forums would be flooded (again) with "Whaaa! My weather skin stopped working!" posts, I'm not seeing that.
I get what you mean, I was only pointing out that making sense or the strength of one's beliefs is not what makes things likely to happen or not. Sometimes things happen, although they defy logic and common sense. Anyway, let's hope that our unshakable beliefs will make our weather skins unshakable as well in the future, and that we won't have to apply temporary "fixes" for like a week or two until a solution is found - I'm all for that. :D
User avatar
nbtc971
Posts: 13
Joined: May 22nd, 2020, 6:10 am

Re: ⭐ Weather.com

Post by nbtc971 »

xenium wrote: June 4th, 2020, 7:27 pm If the weather skins don't work anymore, try :

https://www.deviantart.com/xxenium/art/Windows-10-Weather-Enterprise-UPDATED-4-JUN-2020-801674472

It uses JSON data from the new Weather.com website

Note:
For me it seems to work and without UserAgent !
I thought I posted this earlier, but don't see it. If it was deleted or broke some rule, just let me know and I won't post it again. I'm having an issue with this updated code:

Image

Is this just more issues with weather.com or is there something I can do?
bobalazs
Posts: 5
Joined: June 19th, 2019, 9:34 pm

Re: ⭐ Weather.com

Post by bobalazs »

[

NOTE: This version corrects the @Include files to reflect the new V3 version of the JSON code.


Weather.com_June 11, 2020.rmskin

Thank you for the quick update. working great.
User avatar
xenium
Posts: 702
Joined: January 4th, 2018, 9:52 pm

Re: ⭐ Weather.com

Post by xenium »

nbtc971 wrote: June 12th, 2020, 4:19 am I thought I posted this earlier, but don't see it. If it was deleted or broke some rule, just let me know and I won't post it again. I'm having an issue with this updated code:

Image

Is this just more issues with weather.com or is there something I can do?
I think the skin is Win10 Weather by Eclectic-Tech
For me everything is ok
You have an older version of the skin.
Download the latest version:

V 1.2020.06.10
Corrected spacing for days
Moon Phase on 2 lines when needed
Removed 'null' displays in Day1 high temp and wind gust tooltip
User avatar
nbtc971
Posts: 13
Joined: May 22nd, 2020, 6:10 am

Re: ⭐ Weather.com

Post by nbtc971 »

xenium wrote: June 12th, 2020, 6:37 am I think the skin is Win10 Weather by Eclectic-Tech
For me everything is ok
You have an older version of the skin.
Download the latest version:

V 1.2020.06.10
Corrected spacing for days
Moon Phase on 2 lines when needed
Removed 'null' displays in Day1 high temp and wind gust tooltip
Thank you, I had the version he posted the previous day and thought I was all set. :confused: