It is currently August 31st, 2024, 11:50 pm

Trying to get Gnometer's MSN Weather to show forecast icons

Get help with creating, editing & fixing problems with skins
User avatar
24HourPartyPeople
Posts: 13
Joined: June 12th, 2010, 5:38 pm

Trying to get Gnometer's MSN Weather to show forecast icons

Post by 24HourPartyPeople »

Hi, I've installed Rainmeter just today, so I'm still a novice. I'm having trouble trying to get Gnometer's MSN Weather to show forecast icons. As far as I understand, skins get data from "RegExp". The thing is that I can't find data for those icons in RegExp code for MSN Weather. This is the code:

Code: Select all

(?siU)<link>(.*)</link>.*src=".*/(\d+).gif".* title="(.*)".*\. (.*)&.*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&.*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&.*s">(.*)</a>.*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&.*s">(.*)</a>.*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&.*s">(.*)</a>.*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&
Icon for current weather is 2nd string: *src=".*/(\d+).gif".*

If forecast icons aren't in there, what would I have to do to get them?
[url]http://fresh-grass.deviantart.com/[/url]
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: Trying to get Gnometer's MSN Weather to show forecast icons

Post by poiru »

Getting those forecast icons to show would require extensive knowledge of Rainmeter as Gnometer isn't "designed" to have icons in the bottom/popup area. You'd have to change code in multiple places..

Maybe you could wait for Rainify instead? http://poiru.deviantart.com/#/d2r7q2t
User avatar
24HourPartyPeople
Posts: 13
Joined: June 12th, 2010, 5:38 pm

Re: Trying to get Gnometer's MSN Weather to show forecast icons

Post by 24HourPartyPeople »

But couldn't I return data from a webpage through WebParser? I've been searching a bit and found out that ".*" in RegExp code means skipping data and "(.*)" means collecting data, so I'm assuming that icons have been left out that way.
I'm looking through source code of the webpage and it's all a little confusing. How would I get image url with RegExp?

Part of webpage source code

Code: Select all

<img src="http://blst.msn.com/as/wea3/i/en-us/saw/32.gif" width="35" height="21" alt="Clear" title="Clear" /> Lo: 20&#176;C. Hi: 32&#176;C
And this is RegExp code for that data:

Code: Select all

*src=".*".* title="(.*)".*Lo: (.*)&.*Hi: (.*)&.
So if I write *src="(.*)", will it get the data? Actually, I think this will work: *src=".*/(\d+).gif". Or I am really missing something?

The rest isn't a problem, if I get this data, I'll redesign the skin completely.
[url]http://fresh-grass.deviantart.com/[/url]
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: Trying to get Gnometer's MSN Weather to show forecast icons

Post by poiru »

Download: http://rainmeter.net/forum/viewtopic.php?f=18&t=769

And test with this RegExp to get the stringindexes:

Code: Select all

(?siU)<title>(.*),.*src=".*/(\d+).gif".* title="(.*)".*\. (.*) .*src=".*/(\d+).gif".* title="(.*)".*Lo: (.*)\..*Hi: (.*)\..*src=".*/(\d+).gif".* title="(.*)".*Lo: (.*)\..*Hi: (.*)\..*s">(.*)</a>.*src=".*/(\d+).gif".* title="(.*)".*Lo: (.*)\..*Hi: (.*)\.
User avatar
24HourPartyPeople
Posts: 13
Joined: June 12th, 2010, 5:38 pm

Re: Trying to get Gnometer's MSN Weather to show forecast icons

Post by 24HourPartyPeople »

Thanks a lot! I just realized 1 minute ago that I'd have to change all stringindex numbers. If I understand correctly, you can get data from almost every webpage 8-)
[url]http://fresh-grass.deviantart.com/[/url]
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Trying to get Gnometer's MSN Weather to show forecast icons

Post by Chewtoy »

24HourPartyPeople wrote:Thanks a lot! I just realized 1 minute ago that I'd have to change all stringindex numbers. If I understand correctly, you can get data from almost every webpage 8-)
As long as it isn't java, flash or any other evil format.
I don't think, therefore I'm not.