• Welcome to TodayPlus Boards v2.
 

Weather information from Weather.com

Started by uk_skinner, February 15, 2005, 12:47:30 PM

Previous topic - Next topic

uk_skinner

First, I would like to thank eemond who opened my eyes to the PHP script.  He was also kindly enough to share with me his script.  Without his help, these PHP scripts could not be here.  Also I would like to express my gratitude to users to help me testing them, broesel, thc, ZapMe1, Geezer, Timmy, Wichtel and also Jim for hosting this forum.

There are 3 PHP scripts and almost identical.  The German and French ones pull the information from their weather.com (de.weather and fr.weather).  Both of them have been passed to the their own sites and will be testing there.  The one I posted here will pull all the information from weather.com.  In other words, if you can find the information from this site then you can generate the city.txt

This was considered as public testing and was trying to find out any error in it.  Once it is stable, its final resident site will be discussed.

Before go to the details, just a general warning:  Please back up your PPC before doing any thing.  

The link is: http://72.9.224.178/~tpfansc/rss/weather.php?Citycode=GMXX0039&SFDay=1&Language=GM

I would suggest you copy/paste this link into your browser and test it.  Here are the parameters:

Citycode: It is required.  One of error checking mechanism was in the script.  If you put an invalid Citycode, it will generate an "Error" city.txt.  No information will be in there and "Error!!!" will be in the this.swConText.  In that way, you will see "Error" in the TP.

SFDay:  Optional.  Start Forecast Day (SFDay) allow you to set the first day of the 5-day forecast.  If you don't specify it, the default value is "0" (today).  If you set "SFDay=1" then your 5-day forecast will start at tomorrow.

Language:  Optional.  This will allow you translate the forecast text of current condition into either German (GM), French (FR) or Dutch (NL).  If other language is desired, please post the forecasttext.txt here and I can try to put them in.  Due to the different forecast format used in MSNBC and weather.com, sometimes the PHP could not find the right matched word.  It will take some times to make it perfect.

To let this new generate city.txt can be used in TP, we need to use radar.exe to download it.  I guess all the talent skinner here will work out a way to do it.  Here are some trick issues need to be lay out first.

1)   At this point, there are time file also are generated when TP update the weather and RSS.  There are two numbers in the file.  I would like to ask some help to figure out what these two numbers are. They are important because this file is where TP get latest update time from.  Before figure out a way to generate this time file by ourselves, we still need TP to run the update from MSNBC.  It means twice downloading.
2)   As mentioned above, the MSNBC updating is still needed to generate the time file, a delay updating from weather.com is necessary.  I have a TpExeDelay.exe to do this job.  It will launch programs from a list after TP finishing its own updating.  If you have other program on the list, it is necessary to put radar.exe run first since it will download the city.txt.

I was hoping later we can have these process more simple and effectively.  But at the early stage of this development, a little bit patience is required.

thc

@ uk_skinner,

i just want to thank you for all things! :bow:  :clap:

ZapMe1

UK_Skinner,

Your Talent is nothing short of Amazing!
Thanks again for another Great  Contribution to TP..... :D
ZapMe1

"The most knowledgable person in the world is not the one who possesses the most knowledge, but the one who surrounds themselves with the greatest number of knowledgable people"

Broesel

Quote from: "uk_skinner"At this point, there are time file also are generated when TP update the weather and RSS.  There are two numbers in the file.  I would like to ask some help to figure out what these two numbers are. They are important because this file is where TP get latest update time from.  Before figure out a way to generate this time file by ourselves, we still need TP to run the update from MSNBC.  It means twice downloading.

Thanks again one more time to your efforts :)

I looked into my cityx.txt.time already several times but didn't figure out
for now, what format is used. As we only get the value "updatetime" in
TodayPlus, I think it is Date and Time in whatever format.

The values in my city1.txt.time - city3.txt.time are:

city1:
29692833
1259410432

city2:
29692833
1269410432

city3:
29692833
1279410432

As you can see, only one value was changing, when updating the three
files, so I assume, that is time-related. In the skin it shows for updatetime:
21:59 (means 9:59 pm)

The format of the first numeric string in the files is identical with the
string in some values of the registry (hkcu\software\SRSSoft\TodayPlus\uptime)

f.ex.
batteryTimeUiHigh : 29692951
oldUiBatteryHigh   : 29692951
oldUiSoftresetHigh : 29692951
softresetTimeUiHigh: 29691400

So maybe that string could be date-related in my opinion.
Maybe anybody can take a look at his files and see, if that can be fixed.

Regards Broesel

uk_skinner

Thanks for your good words....:oops:

I forgot to mention one feature in the script.

The 5-day forecast is just like the one in MSNBC one if the day forecast is available from the weather.com.  However, it becomes invalid after 2:00PM.  At this moment, I let script to take the next hourly forecast as day forecast (Temp, Forecast icon and prec.).  In other words, if you use the script to download the city.txt at 4:30PM, the script will give you the 5:00PM forecast as day forecast.  This goes on until the day forecast becomes available again.  If you wish to start tomorrow as the 1st day of the 5-day forecast, just use SFDay=1.

eemond

UK,

Nice work. Thanks for the kudos.

Curious what your weather feed is. I compared this (http://todayplus.jhollin1138.com/rss/forecast_yahoo_txt.php?Citycode=GMXX0039&Language=GM) and found the 5 day forecast to be almost identical (the only thing that differed was the AM an PM Codes).

Regards,
eemond

uk_skinner

Quote from: "eemond"UK,

Nice work. Thanks for the kudos.

Curious what your weather feed is. I compared this (http://todayplus.jhollin1138.com/rss/forecast_yahoo_txt.php?Citycode=GMXX0039&Language=GM) and found the 5 day forecast to be almost identical (the only thing that differed was the AM an PM Codes).

Regards,
eemond

Ed:


I have emailed all my scripts to you.
All the weather information are form weather.com. The 5-day forecast is from:http://www.weather.com/activities/other/other/weather/tenday.html?locid=20850

It does make sense that 5-day forecast should be identical since Yahoo also use weather.com as source.

uk_skinner

A simple weather skin using the city.txt from weather.com and imageviewer for radar image.  Does it look familiar?

Broesel

Quote from: "uk_skinner"A simple weather skin using the city.txt from weather.com and imageviewer for radar image.  Does it look familiar?

Cool, that looks really nice  :D

Maybe my next ppc should be a vga ?

Regards Broesel

uk_skinner

Another proof of concept:  Hourly Forecast

Timmy

Quote from: "uk_skinner"First, I would like to thank eemond who opened my eyes to the PHP script.  He was also kindly enough to share with me his script.  Without his help, these PHP scripts could not be here.  Also I would like to express my gratitude to users to help me testing them, broesel, thc, ZapMe1, Geezer, Timmy, Wichtel and also Jim for hosting this forum.

Uk_skinner,

I thank you, broesel, thc, ZapMe1, Geezer, Wichtel and Jim for all the progress that's made last month. (Who did I forget?!?) It's really amazing that those things are possible!

About a year ago everybody thought the beautiful program called TodayPlus would dy. But happily all the efforts of SRS and all the skinners all over the world it did NOT dy!!!

Thank you all, my fellow skinners!!! It's nice work (sorry: hobby) to do, as one of you said this week.

Uk_skinner, I had some terrible busy days at work, but I've tested some things for you, and this weekend I'll PM you again. Thanks for your nice work!

Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

Timmy

Uk_skinner,

I've noticed some things by critical looking at my PPC screen, my city.txt files and the weather.com weather report website.

1)  I'm 99% sure that the TodayPlus-pic (Rain/Wind)  isn't the right picture. The text is right, everytime, saying something like 'Rain' or 'Drizzle' or 'Light Rain'. That's OK in comparision with the website. But icon 11 (Rain/Wind) and icon 13 (Wind) are not the good pictures for the right, mentioned text.

2)  I'm 55% sure that if there's "PM" in the DAY-text, that the NIGHT-text for that day remains empty.

3)  I think there are some wrong translations in Dutch, so I attach two new translations:
•  UK-NL Forecast txt.doc
•  Weather Icons & Text.doc

4)  The translation from Mph to km is working perfect.

5)  The 'sky-translation' (this.swConTekst in the city.txt file) is also working perfect.

I hope, this report helps you a little bit.

Timmy
______________________________________________
@ALL: In the attached UK-NL forecasttext.doc I've added some missing English textlines, too. You can easily transform this .doc file to the weatherforecast.txt file (used by TodayPlus) by deleting the Duch column and change the table ==> text.
I thought is was 'clever' to give the missing textlines the number of that line. For me, it was easier in the past to change those lines when a new textline was found by me or someone else.
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

uk_skinner

Timmy:

 Thanks.  I saw the "Weather Icons & Text.doc " and will take detail look again.

 I will put your new Dutch translation into weather.php.

Timmy

Quote from: "uk_skinner"Timmy:

 Thanks.  I saw the "Weather Icons & Text.doc " and will take detail look again.

 I will put your new Dutch translation into weather.php.

Uk_skinner,

Thanks for changing the old files for the new one. I'll look to the weather reports of the coming days with a critical eye and report you what I have seen.

Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

uk_skinner

Quote1) I'm 99% sure that the TodayPlus-pic (Rain/Wind) isn't the right picture. The text is right, everytime, saying something like 'Rain' or 'Drizzle' or 'Light Rain'. That's OK in comparision with the website. But icon 11 (Rain/Wind) and icon 13 (Wind) are not the good pictures for the right, mentioned text.

Timmy:

If I read this correctly, we need to change the number of icons in the weather icon folder right?

QuoteI'm 55% sure that if there's "PM" in the DAY-text, that the NIGHT-text for that day remains empty.

Most of time, I believe it was PHP did not find the matched words of forecast in the list.  It could be the space issue.  Sometimes the forecast text from weather.com gets some extra space.  If you find that, please let me the words and I can correct them.