It is currently April 18th, 2024, 11:19 am

wxdata.weather.com service deprecated

Get help with creating, editing & fixing problems with skins
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: wxdata.weather.com service deprecated

Post by Youkai1977 »

@mak_kawa:
Thank you very much, with your help it is now running as desired.
Regarding the "RegExp", I only understand the train station :Whistle , in other words I honestly do not know what is in this line for what. But be it. It's going ... first ... :thumbup:


@balala:
Yes, mak_kawa's tip works perfectly.
I built it all in "learning by doing" manner in my weather skin and now it works.

But as I wrote mak_kawa, at least the command line with the "RegExp", that's too high for me. I don't get anything there. That is definitely still one of the things I have to learn to write with the skin :oops: :Whistle

Now the result:
You do not have the required permissions to view the files attached to this post.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: wxdata.weather.com service deprecated

Post by balala »

Youkai1977 wrote: January 21st, 2020, 6:49 pm Yes, mak_kawa's tip works perfectly.
Does it? I'm extremely surprised, because it doesn't for me, unless I add a UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0 option to the parent WebParser measure. Adding this option fixes the issue and the skin starts working. Short description here: https://forum.rainmeter.net/viewtopic.php?f=119&t=34491&start=10#p170640
Youkai1977 wrote: January 21st, 2020, 6:49 pm I built it all in "learning by doing" manner in my weather skin and now it works.
This is the best way to learn coding.

Could you please pack the whole working config and upload the package? Thank you, if you do.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: wxdata.weather.com service deprecated

Post by mak_kawa »

Hi balala

Yes,"isitraining.in" sites refuses an access with no UserAgent. And Youkai1977's code posted has UserAgent option possibly derived from ms310's code. This is a bit different from that in your UserAgent, but works.

By the way, because of above "isitraining.in"'s policy(?), useful RainRegExp tool of jsmorley does not work for the site. So, as a workaround, I set debug=2 option to Webparser measure, and let RainRegExp read the path of generated file and parse.
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: wxdata.weather.com service deprecated

Post by Youkai1977 »

balala wrote: January 21st, 2020, 7:12 pmDoes it? I'm extremely surprised, because it doesn't for me, unless I add a UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0 option to the parent WebParser measure. Adding this option fixes the issue and the skin starts working. Short description here: https://forum.rainmeter.net/viewtopic.php?f=119&t=34491&start=10#p170640
We would be back at the point "I don't get anything often".
I have no idea what's going on and why it has to be in there. And anyway, do I have to change the version in this line with every Firefox update?
As I said, I usually only take other people's skins and adjust them for me. With many things I now know what they mean and what they are there for. But with more complex code such as a "RegExp" line or your question about the "UserAgent", no plan. :confused: :oops:
And now I could translate every post from their link to me, but if I am smarter then? :???:
balala wrote: January 21st, 2020, 7:12 pmCould you please pack the whole working config and upload the package? Thank you, if you do.
Just my weather skin, or the complete M.A.R.S package? First the weather skin in the attachment.

mak_kawa wrote: January 21st, 2020, 10:03 pm[...] ...possibly derived from ms310's code. [...]
That's exactly how it looks ... I took it over, wondered what it was all about and deleted it first. But ZACK, the skin stopped working. So back in with the line and TADAA everything is fine. But as already mentioned, why, why and why it is needed, no plan. I am simply knitted there, I do not ask, I take on the motto "Never touch a running system". Rainmeter is just a hobby and I don't want to do my doctorate in there. :D
mak_kawa wrote: January 21st, 2020, 10:03 pmBy the way, because of above "isitraining.in"'s policy(?), useful RainRegExp tool of jsmorley does not work for the site. So, as a workaround, I set debug=2 option to Webparser measure, and let RainRegExp read the path of generated file and parse.
That's exactly what I mean. Either the translation is stupid, or I only understand the train station, suitcase, clown. No idea what you could mean by that. :confused: :confused: :confused: :???: :???: :???: :oops:
You do not have the required permissions to view the files attached to this post.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
khernitz
Posts: 5
Joined: January 16th, 2020, 2:02 am

Re: wxdata.weather.com service deprecated

Post by khernitz »

I need help in how to modify the string below so that it will pull the weather data from a working url:

[MeasureGetTemperatureRSS]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=3600
Url=http://wxdata.weather.com/wxdata/weather/local/#CityCode#?cc=*&unit=#TemperatureUnit#
RegExp="(?siU).*<ut>(.*)</ut>.*<dnam>(.*)</dnam>.*<cc>.*<tmp>(.*)</tmp>.*"


Many thanks
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: wxdata.weather.com service deprecated

Post by mak_kawa »

See here.

Generally speaking, changing weather data source needs major modification to skin structure/code including "RegExp=" description. So, it would be an easier way to switch entirely to the skin downloaded from the link listed in above page, honestly.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: wxdata.weather.com service deprecated

Post by jsmorley »

khernitz wrote: January 22nd, 2020, 12:36 pm I need help in how to modify the string below so that it will pull the weather data from a working url:

[MeasureGetTemperatureRSS]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=3600
Url=http://wxdata.weather.com/wxdata/weather/local/#CityCode#?cc=*&unit=#TemperatureUnit#
RegExp="(?siU).*<ut>(.*)</ut>.*<dnam>(.*)</dnam>.*<cc>.*<tmp>(.*)</tmp>.*"


Many thanks
It's not that simple, but since I don't have your entire skin code, all I can do is respond to precisely what you asked.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureSite]
Measure=WebParser
URL=https://weather.com/weather/today/l/USVA0944
RegExp=(?siU)^(.*)$

[MeasureCurrent]
Measure=WebParser
URL=[MeasureSite]
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)(?(?=.*<div class="today_nowcard-feels).*"><span class="btn-text">(.*)<!----> </span><span class="deg-feels" className="deg-feels">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-hilo").*><span class="btn-text">.*<!----> </span><span class="deg-hilo-nowcard"><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<span class="btn-text">.*<!---->).* </span><span class="deg-hilo-nowcard"><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-sidecar component panel"><table><caption>(.*)</caption><tbody>).*<tr><th>(.*)</th><td><span class="">(.*)</span></td></tr><tr><th>(.*)</th><td><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span></span></span></td></tr><tr><th>(.*)</th><td><span class="">(.*)<sup>(.*)</sup></span></td></tr><tr><th>(.*)</th><td><span class="">(.*)<!---->.*</span></td></tr><tr><th>(.*)</th><td><span class="">(.*)</span></td>)

[MeasureUT]
Measure=WebParser
URL=[MeasureSite]
StringIndex=0
RegExp=(?siU)<span class="icon icon-font iconset-ui icon-globe" className="icon icon-font iconset-ui icon-globe"></span><span>.*</span><span class="styles__borderLeft__2zhrE">°(.*)</span>
StringIndex2=1

[MeasureDNAM]
Measure=WebParser
URL=[MeasureSite]
StringIndex=0
RegExp=(?siU)(?(?=.*<h1 class="h4 today_nowcard-location").* className="h4 today_nowcard-location">(.*)<span class=".*" className=".*"></span></h1>)
StringIndex2=1

[MeasureTMP]
Measure=WebParser
URL=[MeasureCurrent]
StringIndex=4

[MeterUT]
Meter=String
MeasureName=MeasureUT
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1

[MeterDNAM]
Meter=String
MeasureName=MeasureDNAM
Y=2R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1

[MeterTMP]
Meter=String
MeasureName=MeasureTMP
Y=2R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1


1.png


As has been said, it might be easier in the long run to find a weather skin you like starting at:

Weather Skins

Or if you want to figure out how to do it correctly, yourself, try:

Some help with parsing Weather.com
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: wxdata.weather.com service deprecated

Post by jsmorley »

UserAgent is something that is passed to a web site when you connect to it with HTTP or HTTPS.

Rainmeter and RainRegExp use a UserAgent string of "Rainmeter WebParser plugin".

If some site doesn't like that, you can force the value on all "parent" WebParser measures in your skin.

https://docs.rainmeter.net/manual/measures/webparser/#UserAgent

Finding a UserAgent string that is pretty common is easy. Just go to:

https://www.whatismybrowser.com/detect/what-is-my-user-agent

in the browser you use, and copy the string it will return.

Then set it as:

UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

or whatever string your browser returns.

For Google Chrome, it might be:

UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36

What UserAgent string you use isn't all that important, and it isn't something you need to worry about keeping "current". Just use any common browser of any reasonably current version, and it's fine. Maybe update it every 10 years or so... Just don't use any version of Microsoft Internet Explorer. The web hates that browser. Microsoft Edge is fine, Microsoft Internet Explorer is just crap.

The entire point is just so the website you connect to says "Ah, this is a connection from a desktop web browser. Cool!".

Very few web sites will restrict access based on UserAgent. Mind you, many will look at the UserAgent and perhaps use different code (possibly giving you different output) if it finds that you are using an older version of Microsoft Internet Explorer, or some other ancient or crappy web browser, but very few will try to insist that a particular UserAgent string be used. Something for instance that specifies that it is based on at least Mozilla/5.0. There are other ways a site can restrict access to insist on a web browser with a human in front of it (so they can get advertising in front of you), and UserAgent is pretty brute-force and unreliable for them. Still, it's possible...


P.S. You can add the option to the Rainmeter.data file in ..AppData\Local\Rainmeter, and then ALL WebParser parent measures in all your skins will automatically use that UserAgent setting. I don't particularly recommend this approach, as 1) It's just not needed for 99.9% of web sites, 2) This will make for unreliable results when using RainRegExp to try and figure out your regular expressions, and 3) You can't "distribute" Rainmeter.data with your skins, so your users won't get it. I would use this setting only "when" you really need it, and "where" you really need it.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: wxdata.weather.com service deprecated

Post by balala »

Youkai1977 wrote: January 22nd, 2020, 10:04 am We would be back at the point "I don't get anything often".
I have no idea what's going on and why it has to be in there. And anyway, do I have to change the version in this line with every Firefox update?
As I said, I usually only take other people's skins and adjust them for me. With many things I now know what they mean and what they are there for. But with more complex code such as a "RegExp" line or your question about the "UserAgent", no plan. :confused: :oops:
And now I could translate every post from their link to me, but if I am smarter then? :???:
See jsmorley's reply above.
Youkai1977 wrote: January 22nd, 2020, 10:04 am Just my weather skin, or the complete M.A.R.S package? First the weather skin in the attachment.
It's ok. It does work, but the parent WebParser measure ([MeasureSite]) has set a UserAgent option. If I remove this option, the skin stops working. So this option is absolutely needed, to get the skin working.
User avatar
khernitz
Posts: 5
Joined: January 16th, 2020, 2:02 am

Re: wxdata.weather.com service deprecated

Post by khernitz »

Many thanks man
jsmorley wrote: January 22nd, 2020, 1:01 pm It's not that simple, but since I don't have your entire skin code, all I can do is respond to precisely what you asked.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureSite]
Measure=WebParser
URL=https://weather.com/weather/today/l/USVA0944
RegExp=(?siU)^(.*)$

[MeasureCurrent]
Measure=WebParser
URL=[MeasureSite]
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)(?(?=.*<div class="today_nowcard-feels).*"><span class="btn-text">(.*)<!----> </span><span class="deg-feels" className="deg-feels">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-hilo").*><span class="btn-text">.*<!----> </span><span class="deg-hilo-nowcard"><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<span class="btn-text">.*<!---->).* </span><span class="deg-hilo-nowcard"><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-sidecar component panel"><table><caption>(.*)</caption><tbody>).*<tr><th>(.*)</th><td><span class="">(.*)</span></td></tr><tr><th>(.*)</th><td><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span></span></span></td></tr><tr><th>(.*)</th><td><span class="">(.*)<sup>(.*)</sup></span></td></tr><tr><th>(.*)</th><td><span class="">(.*)<!---->.*</span></td></tr><tr><th>(.*)</th><td><span class="">(.*)</span></td>)

[MeasureUT]
Measure=WebParser
URL=[MeasureSite]
StringIndex=0
RegExp=(?siU)<span class="icon icon-font iconset-ui icon-globe" className="icon icon-font iconset-ui icon-globe"></span><span>.*</span><span class="styles__borderLeft__2zhrE">°(.*)</span>
StringIndex2=1

[MeasureDNAM]
Measure=WebParser
URL=[MeasureSite]
StringIndex=0
RegExp=(?siU)(?(?=.*<h1 class="h4 today_nowcard-location").* className="h4 today_nowcard-location">(.*)<span class=".*" className=".*"></span></h1>)
StringIndex2=1

[MeasureTMP]
Measure=WebParser
URL=[MeasureCurrent]
StringIndex=4

[MeterUT]
Meter=String
MeasureName=MeasureUT
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1

[MeterDNAM]
Meter=String
MeasureName=MeasureDNAM
Y=2R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1

[MeterTMP]
Meter=String
MeasureName=MeasureTMP
Y=2R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1



1.png



As has been said, it might be easier in the long run to find a weather skin you like starting at:

Weather Skins

Or if you want to figure out how to do it correctly, yourself, try:

Some help with parsing Weather.com