It is currently March 28th, 2024, 2:11 pm

Weather Parser not working

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

Re: Weather Parser not working

Post by balala »

DanielPodo wrote:This should be nice and easy, but I'm not getting anything. Any reason why?
Yep, there are some missing things in the RegExp expression. I marked them red: RegExp=(?siU)<td>Country</td>[color=#FF0000].*[/color]<td>(.*)</td>.*<td>City</td>[color=#FF0000].*[/color]<td>(.*)</td>.
Between the <td>Country</td> and <td>(.*)</td> (with the country name) expressions a new line character exists. The initial RegExp fails, because it can't find those two strings, one after the other. Same things for the City.
User avatar
DanielPodo
Posts: 77
Joined: March 30th, 2016, 1:50 pm

Re: Weather Parser not working

Post by DanielPodo »

balala wrote:Yep, there are some missing things in the RegExp expression. I marked them red: RegExp=(?siU)<td>Country</td>[color=#FF0000].*[/color]<td>(.*)</td>.*<td>City</td>[color=#FF0000].*[/color]<td>(.*)</td>.
Between the <td>Country</td> and <td>(.*)</td> (with the country name) expressions a new line character exists. The initial RegExp fails, because it can't find those two strings, one after the other. Same things for the City.
I was wondering whether or not I needed to put something in there to indicate a newline character. Thanks!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Parser not working

Post by balala »

DanielPodo wrote:I was wondering whether or not I needed to put something in there to indicate a newline character. Thanks!
Does it work?
User avatar
DanielPodo
Posts: 77
Joined: March 30th, 2016, 1:50 pm

Re: Weather Parser not working

Post by DanielPodo »

balala wrote:Does it work?
Perfectly. :D Much faster than a variation I had which also used Yahoo Weather.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Parser not working

Post by balala »

DanielPodo wrote:Perfectly. :D Much faster than a variation I had which also used Yahoo Weather.
Great. I'm glad.
Post Reply