It is currently March 29th, 2024, 11:10 am

Weather Skins Not Working

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by balala »

dgmele wrote: August 3rd, 2020, 5:54 pm Because I'm using Imperial units my inelegant solution is to add the following substitution to my skin:
A little bit more elegant is the following substitution: Substitute=".000":""
Mylasthorcrux
Posts: 11
Joined: January 16th, 2020, 5:16 pm

Re: Weather Skins Not Working

Post by Mylasthorcrux »

jsmorley wrote: July 29th, 2020, 3:38 pm I'm looking at it. It looks like the format of the JSON code has changed a bit, with some leading and trailing \ characters added to the keys and values.

I don't know how much effort will be involved in fixing this, and I can't be certain yet that this is in fact a real, permanent change. I will be working on it and watching the site today.

EDIT:

Ok, I think I have fully addressed the new issues with the weather.com site.

Please get the .rmskin at: https://forum.rainmeter.net/viewtopic.php?f=118&t=34628#p171501

Alternatively, if you have a skin that YOU wrote that was based on the @Include .inc files that come with this skin, you can simply get this:


@IncludeFiles.zip


And copy all the .inc files from that .zip into the @Resources folder of your skin.

ONE IMPORTANT NOTE!

The new approach of using the API for the weather.com JSON requires a change to how you access a particular location.

All of the location "codes", like USVA0944 or bbd510e73cb5870f973cea9253bb1f9bfe239a129dfc2b89589cbb6d2d46b4bc or 22308 and such are NO LONGER SUPPORTED.

The new approach requires that you provide a Latitude and Longitude in the WeatherComJSONVariables.inc file. See that file for details on how you can get that for your location.

Please read WeatherCOMJSONVariables.inc carefully, it HAS changed.
Thnx ;-)

Image
bravo-lemur
Posts: 24
Joined: August 20th, 2020, 8:49 pm

Re: Weather Skins Not Working

Post by bravo-lemur »

As of this afternoon, I'm getting "Wrong format" errors for a bunch of recently-patched weather skins again (e.g. Weatherbox, Lottaweather). Anyone have an idea what the cause is?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

dvo wrote: August 20th, 2020, 8:54 pm JsMorley .... weather is buggy again .. :-( it's happening again... hopefully it will come back 2 morrow....
bottom part is nearly empty ...of your skin... guys the pro's have to look in to it and this will take some time ... so waiting will not help 4 now
Yeah, I don't think it's something serious, just some minor section name changes in the forecast area (e.g. getSunV3DailyForecastUrlConfig is now getSunV3DailyForecastWithHeadersUrlConfig). The API JSON method doesn't seem to be affected by this, at least for me, but the main page JSON parsing might need some (hopefully) minor tweaks.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
bravo-lemur
Posts: 24
Joined: August 20th, 2020, 8:49 pm

Re: Weather Skins Not Working

Post by bravo-lemur »

Yincognito wrote: August 20th, 2020, 9:38 pm Yeah, I don't think it's something serious, just some minor section name changes in the forecast area (e.g. getSunV3DailyForecastUrlConfig is now getSunV3DailyForecastWithHeadersUrlConfig). The API JSON method doesn't seem to be affected by this, at least for me, but the main page JSON parsing might need some (hopefully) minor tweaks.
Sorry for the totally noob-ish question, but can you point me in the direction of where to check those section names so I can update the skin I'm using? Thanks!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

The JSON API version of the weather is fine for me. I can't say about any skins parsing the embedded JSON in the HTML, I just don't use that approach anymore.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

bravo-lemur wrote: August 20th, 2020, 9:48 pm Sorry for the totally noob-ish question, but can you point me in the direction of where to check those section names so I can update the skin I'm using? Thanks!
Just open the actual URL in the browser (I believe jsmorley's skin here can do that too by clicking on the weather icon, although it's based on the API JSON method nowadays), right click inside the webpage and choose "View Page Source" (that's how it's called in Chrome, it may be named a bit differently in other browsers) from the context menu. A new tab will open with the associated HTML, which you can then copy, save, search into it using CTRL+F, etc.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Great.

I don't want to make a big deal out of this, as with Rainmeter, there are always alternative ways to accomplish things, that is one of the big charms of Rainmeter.

However... I pretty strongly feel that everyone who wants to use weather.com should be using the latest @Include .inc files that I provide with the .rmskin in:

https://forum.rainmeter.net/viewtopic.php?f=118&t=34628#p171501

In my view, this the only safe way to get the info for weather.com right now. You just CANNOT depend on parsing an HTML website for the long-term, as the site WILL change, maybe not today, maybe not tomorrow, but soon. It's guaranteed …

In addition, I just don't see any real purpose in having multiple approaches to parsing the JSON API data floating around. While they all may work just fine, it certainly makes answering questions and supporting users a lot more complicated.

I'm not suggesting that everyone use my "skin". Not at all. It works for me, but anyone can build weather skins, based on the same "plug-and-play" .inc files, and have it display and look exactly as they want. All I'm suggesting is that the .inc file approach allows us to separate the data "back-end" from the display "front-end", and I really strongly recommend that we all use the same "back-end". I will certainly keep it absolutely current as the needs arise, and this is one time when it will sure simplify things if we all are singing from the same songsheet.
bravo-lemur
Posts: 24
Joined: August 20th, 2020, 8:49 pm

Re: Weather Skins Not Working

Post by bravo-lemur »

jsmorley wrote: August 20th, 2020, 10:44 pm Great.

I don't want to make a big deal out of this, as with Rainmeter, there are always alternative ways to accomplish things, that is one of the big charms of Rainmeter.

However... I pretty strongly feel that everyone who wants to use weather.com should be using the latest @Include .inc files that I provide with the .rmskin in:

https://forum.rainmeter.net/viewtopic.php?f=118&t=34628#p171501

In my view, this the only safe way to get the info for weather.com right now. You just CANNOT depend on parsing an HTML website for the long-term, as the site WILL change, maybe not today, maybe not tomorrow, but soon. It's guaranteed …

In addition, I just don't see any real purpose in having multiple approaches to parsing the JSON API data floating around. While they all may work just fine, it certainly makes answering questions and supporting users a lot more complicated.

I'm not suggesting that everyone use my "skin". Not at all. It works for me, but anyone can build weather skins, based on the same "plug-and-play" .inc files, and have it display and look exactly as they want. All I'm suggesting is that the .inc file approach allows us to separate the data "back-end" from the display "front-end", and I really strongly recommend that we all use the same "back-end". I will certainly keep it absolutely current as the needs arise, and this is one time when it will sure simplify things if we all are singing from the same songsheet.
I've bitten the bullet - currently re-building my skin based on yours rather than Weatherbox, which was parsing the HTML.

Is there a way to parse the sunset/sunrise hour and minutes separately? I previously made a little roundline suntrail, but it relies on being able to calculate the difference in time in minutes, so I'm not sure how to do that with the current .inc file measures.

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

Re: Weather Skins Not Working

Post by jsmorley »

bravo-lemur wrote: August 20th, 2020, 11:21 pm I've bitten the bullet - currently re-building my skin based on yours rather than Weatherbox, which was parsing the HTML.

Is there a way to parse the sunset/sunrise hour and minutes separately? I previously made a little roundline suntrail, but it relies on being able to calculate the difference in time in minutes, so I'm not sure how to do that with the current .inc file measures.

Thank you!

Code: Select all

[MeasureSunRiseHourString]
Measure=String
String=[@CurrentSunriseTime]
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.*):.*$":"\1"

[MeasureSunRiseMinuteString]
Measure=String
String=[@CurrentSunriseTime]
DynamicVariables=1
RegExpSubstitute=1
Substitute="^.*:(.*) .*$":"\1"

[MeasureSunRiseHourNumber]
Measure=Calc
Formula=[MeasureSunRiseHourString]
DynamicVariables=1

[MeasureSunRiseMinuteNumber]
Measure=Calc
Formula=[MeasureSunRiseMinuteString]
DynamicVariables=1

1.jpg
You do not have the required permissions to view the files attached to this post.