It is currently February 17th, 2020, 5:20 am

⭐ Weather Skin using Weather.com

Post your work-in-progress and completed skins to share and discuss.
User avatar
jsmorley
Developer
Posts: 20225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

⭐ Weather Skin using Weather.com

Post by jsmorley »

As everyone is already aware, there is currently (maybe permanently) an issue with any skins using the wxdata feed as a source for a weather skin in Rainmeter.

The wxdata feed is currently unavailable, and may or may not come back online in the future.

One of several alternatives for this is to use regular expression to parse the actual weather.com website.

Here is my weather skin, converted to use this new approach:


Weather.com_Jan 27, 2020.rmskin


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

Re: Weather Skin using Weather.com

Post by jsmorley »

Settings for this skin can be changed by right-clicking the skin and selecting "Edit Weather Variables" from the context menu.

That will open the file WeatherComVars.inc in your text editor. Make changes as desired, save and refresh.

Code: Select all

[Variables]

; Getting and setting your LocationCode can be done one of several ways.
; 
; Go to https://weather.com/
; Search for your city by name.
; Use the long number at the end of the resulting URL, for example:
; https://weather.com/weather/today/l/1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
; The LocationCode would be 1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
; Copy and enter that as the value for LocationCode below.
; LocationCode=1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
;
; You can also use the location code used in earlier skins using wxdata as the source.
; LocationCode=USVA0944
;
; Alternatively, in the USA, you can simply use your ZipCode as the LocationCode.
; LocationCode=22308

LocationCode=USVA0944

; If another language or unit(s) of measures are desired, simply go to https://weather.com/
; Using the controls at the top of the page, set your country and units of measure as desired.
; Copy and enter the Language from the resulting URL.

; For example, French would be Language=fr-FR
; The unit(s) of measure are automatic, based on the language.
; For instance, you cannot have the language be French, but the units be F imperial.

; Note however, that simply changing from imperial F to metric C units of measure while keeping the 
; langage as English can be done by using en-GB as the Language.
 
Language=en-US

; How often to update the weather information. Default is 600 or 10 minutes.

UpdateRate=600
User avatar
SilverAzide
Posts: 680
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skin using Weather.com

Post by SilverAzide »

jsmorley wrote:
January 17th, 2020, 3:18 pm
Here is my weather skin, converted to use this new approach:
Thank you! A few years ago, someone (was it you???) created a full set of regex's that were easy to drop into a skin to grab all the weather attributes from the wxdata feed. Is there something like that in this skin? In theory, all the attributes are there in the HTML, so a canned set of regex's would allow devs to semi-sorta-quickly convert a wxdata skin to a weather.com skin....
DeviantArt Gadgets More...
User avatar
jsmorley
Developer
Posts: 20225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skin using Weather.com

Post by jsmorley »

SilverAzide wrote:
January 17th, 2020, 4:05 pm
Thank you! A few years ago, someone (was it you???) created a full set of regex's that were easy to drop into a skin to grab all the weather attributes from the wxdata feed. Is there something like that in this skin? In theory, all the attributes are there in the HTML, so a canned set of regex's would allow devs to semi-sorta-quickly convert a wxdata skin to a weather.com skin....
I'm looking into that, it's not quite as straightforward as wxdata was.
User avatar
jsmorley
Developer
Posts: 20225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skin using Weather.com

Post by jsmorley »

xenium's regular expression(s) found in @Resources\WeatherComRegExp.inc is pretty much what you would want to convert any skin to use this approach. What there isn't today yet is a cross-reference to the StringIndex(s) and what elements they point to and mean. That might take some doing.

His regular expression(s) have a total of 307 StringIndex values they capture.
User avatar
jsmorley
Developer
Posts: 20225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skin using Weather.com

Post by jsmorley »

I have not yet implemented the "alerts" stuff into this skin, but will be doing so shortly.
User avatar
SilverAzide
Posts: 680
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skin using Weather.com

Post by SilverAzide »

jsmorley wrote:
January 17th, 2020, 4:13 pm
I have not yet implemented the "alerts" stuff into this skin, but will be doing so shortly.
I am anxiously awaiting stealing as much stuff from your skin as possible. :D
DeviantArt Gadgets More...
User avatar
JohnBurns
Posts: 46
Joined: February 11th, 2011, 4:18 pm
Location: Oklahoma City

Re: Weather Skin using Weather.com

Post by JohnBurns »

Thanks for the info - helps a lot.
Microsoft Windows 10 x64 v1809build 17763.134
Resident:Windows Defender, Malwarebytes Premium 3.6.1, Windows UAC at highest level
OnDemand: HitmanPro, Emisoft Emergency Kit, MRT
Backups: Macrium Reflect Premium (System Daily) EaseUS Todo Home (System Weekly)
Browser: Google Chrome
Rainmeter, Open Shell Start, Rainmeter, XWidget
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3758
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Weather Skin using Weather.com

Post by eclectic-tech »

SilverAzide wrote:
January 17th, 2020, 4:19 pm
I am anxiously awaiting stealing as much stuff from your skin as possible. :D
Get in line! :oops: :lol:

ALTERNATE WEATHER SOURCE ISSUES
I looked at using Dark Sky or Open Weather Map, both offer free access to JSON weather data, but both have issues that prevent any possible use as replacements.

DARK SKY
Dark Sky Terms of Service state:
you will not:
..
direct your end-users to sign up for their own API account (The Dark Sky API not intended to be used directly by end-users);
So distributing a weather skin telling people to sign up for their own key is a violation of their terms of use.

OPENWEATHERMAP
Open Weather Map' free API updates only every 2 hours so it is not an appealing choice as a source for current weather data.

MY CONCLUSION
So scraping TWC is the direction I am leaning towards. Thanks to the work done by Xenium, it should be a fairly painless process! :rosegift:
User avatar
brax64
Posts: 31
Joined: July 8th, 2018, 8:05 pm

Re: Weather Skin using Weather.com

Post by brax64 »

First of all I wanna really thank @JsMorley and @xxenium for the great job!!

Just modified my last skin following the scheme used by JsMorley and it's working beautifully, also did test the location code in the usual format like USXX0000 and it's working