• Welcome to TodayPlus Boards v2.
 

Weather Information Extract From Yahoo

Started by uk_skinner, February 03, 2005, 06:00:55 PM

Previous topic - Next topic

uk_skinner

Thanks to eemond (King of PHP script), not only once but twice.  I only will announce this one and let ZapMe1 does the other one.

Here is the idea:  The weather information TP downloads is from MSNBC weather site.  The information was downloaded and stored as cityXX.txt (XX is city ID) in Buff folder.  As you might noticed, the information was not very updated (for my home town, it always over 2 hours late).  Just like MSNBC, Yahoo also gets weather information from weather.com and the ones on Yahoo is always updated every 60 minutes (at least true in my case).  If this is also true for you, then this PHP script will extract the most updated weather information from the Yahoo and "merge" the one from MSNBC to create a "hybrid" cityXX.txt.  At this time, no need to change or add new codes in the skin. The reason we still need MSNBC ones, becuase some of information are not provided from Yahoo.

How does this work?  

1)  Add this url address into your radar.txt, like this:  change the citycode and cityID according to your needs.

SURL=http://todayplus.jhollin1138.com/rss/forecast_yahoo_txt.php?Citycode=USMA0056
STOR=\Program Files\TodayPlus\Buffer\city1.txt
FORM


note:  if you try to do copy/paste from here, you will get the "extra space" at the end of each line.  This will cause an error in radar.exe.  

2)  Use radar.exe to download the "hybrid" cityXX.text.  The "hybrid" cityXX.text looks different from the original one but the function is the same.  
note:  The original cityXX.txt will be overwriten.  If you wish to get the original one back, just delete the "hybrid" ones and redo the "Update".

3)  By putting the radar.exe into TpDelay.txt, this "merge" action can be linked to normal update action in TP, then the "hybrid" one can be generated each time you do the updating.

Note:  This PHP script only will work for Yahoo site no other weather site.

Please see before(MSNBC) at left and after(Hybrid) at right

Broesel

Well eemond and uk_skinner, this is really good news  :D
Thanks for giving us a second possibility to download weatherinformations.
Maybe not far away, we can get weatherinformations from German, French and other Servers  8)

Tryed this first time for my homecity, everything worked, but did not
get a weathericon. Took a look in the city1.txt and there is a line:
this.swCIcon = "52/9" , where the icon-numer should be.

Could you take a look ?

attaching my city1.txt (rename to txt from zip)

Greetings Broesel

Broesel

Quote from: "ZapMe1"
As far as I know, this can only be used for US Zipcodes at this time !!  Maybe soon, we can find a way to expand this !!!!

Another great expansion of TodayPlus, thanks to all that helped to this,
and I hope you are able to expand this for European textes tooo ..  :D

Greetings Broesel

eemond

Broesel,

Please try again, I just uploaded an updated PHP Script.

Thanks...

Regards,
eemond

uk_skinner

Quote from: "Broesel"
Quote from: "ZapMe1"
As far as I know, this can only be used for US Zipcodes at this time !!  Maybe soon, we can find a way to expand this !!!!

Another great expansion of TodayPlus, thanks to all that helped to this,
and I hope you are able to expand this for European textes tooo ..  :D

Greetings Broesel

Broesel:

 I just have a major break-through to get SID code from wetteronline.de.  If this hold, there is possibility to get forecast text from weeteronline.de  Cross your fingers.

:lol:

Broesel

Quote from: "eemond"Broesel,

Please try again, I just uploaded an updated PHP Script.

Thanks...

Regards,
eemond

Yesssssss,  worked  :D

Broesel

Broesel

Quote from: "uk_skinner"
Broesel:
I just have a major break-through to get SID code from wetteronline.de.  If this hold, there is possibility to get forecast text from weeteronline.de  Cross your fingers. :lol:

Good news, keep up the good work  :lol:  :lol:

Broesel

thc

nice work!

@eedmond and uk_skinner

do you think is it possible to make the same thing with local yahoo weather like http://fr.weather.yahoo.com//FRXX/FRXX0076/index_c.html? it would be nice to have all weather info in our language...

Broesel

Quote from: "thc"
do you think is it possible to make the same thing with local yahoo weather like http://fr.weather.yahoo.com//FRXX/FRXX0076/index_c.html? it would be nice to have all weather info in our language...

I have an url for Germany too (but uk_skinner, wetteronline.de would be better)

http://de.weather.yahoo.com/GMXX/GMXX0039/index_c.html

Greetings Broesel

uk_skinner

thc, broesel:

 I did not see any forecast details in the sites you provided.  They did have simple forecast text for each day, but didn't you get them translated into your language by using forecasttext.txt?

thc

@ uk_skinner,

i'm talking about current weather not for forecast, but if you want http://fr.weather.com/weather/local/FRXX0076?par=yahoo&site=fr.yahoo.com&promo=template are more forecast prevision and more current informations...

Broesel

Quote from: "uk_skinner"thc, broesel:

 I did not see any forecast details in the sites you provided.  They did have simple forecast text for each day, but didn't you get them translated into your language by using forecasttext.txt?

Well, I thought about pulling the informations from there, didn't try that
page with the php-script.

Take a look at the screenshot , should only be an example for other
weathertextes in German.

Broesel

Edit: Screenshot deletet because not enough upload-quota

uk_skinner

thc:

 Ok, you want to get current weather information into city.txt, right?

broesel:

 The PHP sript looks for English key word, so it will not be able to extract the forecast from German yahoo site.

thc

Quote from: "uk_skinner"thc:

 Ok, you want to get current weather information into city.txt, right?

that's right! if is it possible, of course!

Broesel

Quote from: "uk_skinner"broesel:
 The PHP sript looks for English key word, so it will not be able to extract the forecast from German yahoo site.

Sorry, I didn't make me clear, it should only be a possible url to get
weatherinformation into city.txt.  I know, it doesn't work yet. But take
your time, to test all things you need ......

Broesel