It is currently February 23rd, 2024, 4:33 am

Weather with Mond Skin isn't working

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather with Mond Skin isn't working

Post by Yincognito »

relaxhunt wrote: February 14th, 2023, 10:51 am mine isn't working just a C and no more
Well, considering that the quoted reply was around a year ago and Yahoo had the habit of constantly changing their page source in the meantime, it's no wonder. I was working for a regex pattern for a post in another thread (dealing with Yahoo weather as well), but it takes a while to make it right and complete, while I currently have other projects that I want to finish. The RegExp option pattern is unfinished of course, as it was meant to be a full solution (til Yahoo decides to change their page source again, that is), but it's somewhat similar to those already existing:

Code: Select all

(?siU)<div class="weather-details-wrapper.*>.*<div id=module-location-heading.*>.*<h1 .*>(.*)<\/h1>.*<h2 .*>(.*)<\/h2>.*<img .*>.*<p .*>(.*)<\/p>.*<span .*>(.*)(?:&deg;)?<\/span>.*<svg .*>.*<span .*>(.*)(?:&deg;)?<\/span>.*<div class="temperature-forecast.*>.*<span .*>(.*)<\/span>.*<span .*>.*<\/span>.*<div id=module-weather-forecast.*>.*<ul class="hourlyForecast.*>.*<li .*>.*<time>(.*)<\/time>.*<div class="item temperature.*>.* alt=(.*)>.*<dd .*>(.*)<\/dd>.*<\/div>.*<div class="item precipitation.*>.*<dt>(.*)<\/dt>.*<\/div>.*<div class="item wind.*>.*<dd .*>(.*)<\/dd>.*<\/div>.*<\/li>.*<table class=.*dailyForecast.*>(.*)<div id=module-weather-precipitation.*>.*<div id=module-weather-wind-pressure.*>.*<div id=module-weather-details.*>.*<div id=module-weather-sun-moon.*>.*<div id=module-weather-map.*>.*
I don't know if it helps, but if impatient for other solution, one can continue developing it bit by bit - for the record, I progressed up until after the <div class="item wind.*>.*<dd .*>(.*)<\/dd>.*<\/div> part. Basically, everything "should" work up until there.

The thing is just a matter of investigating the webpage's source text (with or without right clicking to "Inspect" the elements and taking into account that the former shows a formatted version compared to the source, e.g. quotes might be present there while missing in the source and so on) and adding the proper regex pattern after the part I mentioned above. It's not terribly hard if you have a PCRE flavor configured site like RegExr.com or RegEx101.com to assist you in testing, but it requires a basic regular expression knowledge, some focus, patience, and obviously time. ;-)
Last edited by Yincognito on February 14th, 2023, 1:00 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
relaxhunt
Posts: 3
Joined: February 14th, 2023, 10:46 am

Re: Weather with Mond Skin isn't working

Post by relaxhunt »

Yincognito wrote: February 14th, 2023, 11:51 am Well, considering that the quoted reply was around a year ago and Yahoo had the habit of constantly changing their page source in the meantime, it's no wonder. I was working for a regex pattern for a post in another thread (dealing with Yahoo weather as well), but it takes a while to make it right and complete, while I currently have other projects that I want to finish. The RegExp option pattern is unfinished of course, as it was meant to be a full solution (til Yahoo decides to change their page source again, that is), but it's somewhat similar to those already existing:

Code: Select all

(?siU)<div class="weather-details-wrapper.*>.*<div id=module-location-heading.*>.*<h1 .*>(.*)<\/h1>.*<h2 .*>(.*)<\/h2>.*<img .*>.*<p .*>(.*)<\/p>.*<span .*>(.*)(?:&deg;)?<\/span>.*<svg .*>.*<span .*>(.*)(?:&deg;)?<\/span>.*<div class="temperature-forecast.*>.*<span .*>(.*)<\/span>.*<span .*>.*<\/span>.*<div id=module-weather-forecast.*>.*<ul class="hourlyForecast.*>.*<li .*>.*<time>(.*)<\/time>.*<div class="item temperature.*>.* alt=(.*)>.*<dd .*>(.*)<\/dd>.*<\/div>.*<div class="item precipitation.*>.*<dt>(.*)<\/dt>.*<\/div>.*<div class="item wind.*>.*<dd .*>(.*)<\/dd>.*<\/div>.*<\/li>.*<table class=.*dailyForecast.*>(.*)<div id=module-weather-precipitation.*>.*<div id=module-weather-wind-pressure.*>.*<div id=module-weather-details.*>.*<div id=module-weather-sun-moon.*>.*<div id=module-weather-map.*>.*
I don't know if it helps, but if impacient for other solution, one can continue developing it bit by bit - for the record, I progressed up until after the <div class="item wind.*>.*<dd .*>(.*)<\/dd>.*<\/div> part. Basically, everything "should" work up until there.

The thing is just a matter of investigating the webpage's source text (with or without right clicking to "Inspect" the elements and taking into account that the former shows a formatted version compared to the source, e.g. quotes might be present there while missing in the source and so on) and adding the proper regex pattern after the part I mentioned above. It's not terribly hard if you have a PCRE flavor configured site like RegExr.com or RegEx101.com to assist you in testing, but it requires a basic regular expression knowledge, some focus, patience, and obviously time. ;-)

Thanks it help me a lot :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather with Mond Skin isn't working

Post by Yincognito »

relaxhunt wrote: February 14th, 2023, 12:46 pm Thanks it help me a lot :thumbup:
You're welcome - just remember to look for as unique as possible patterns in every case. ;-)

For example, in your previous reply, you had something like <div class="My\(2px\).*60x60\/(.*)@2x.png.*. Needless to say, the site can decide tomorrow that it should replace "My" with some other name for the class, set its border or whatever to more than "2px", or the icon dimensions to something different than "60x60", not to mention that you'd encounter such parts in a ton of other places in the source, in effect making them unreliable as durable "anchors" you can stick your "(.*)" captures to. On the other hand, something like <div class="temperature-forecast.*"> looks better in that regard since it's quite descriptive for the site not to consider changing it to something else and break your hard worked parsing of its source.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth