INTRODUCTION:
Spb Weather is a great application to display the forecast of your chosen cities on your Pocket PC’s Today screen. The only disadvantage is that it only comes loaded with scripts designed for US Cities! The answer to this is to create your own scripts that read local weather websites, and have this information imported to Spb Weather.
I have written two scripts to access http://www.weatherchannel.com.au and these are called “WeatherChan_PC.tpl” and “WeatherChan_Suburb.tpl” respectively. They can be downloaded from the PDAGold website at: http://pdagold.com/themes/detail.asp?t=11968
INSTALLING THE SCRIPTS:
Once both scripts have been downloaded to your desktop computer, copy them across to the root directory of your Pocket PC. Open the “Options” screen for Spb Weather; tap “Tools” and then “Weather Sources”. Tap “Add” and then “Browse”. Locate “WeatherChan_Suburb.tpl” and tap “OK”. You should see "WeatherChan_Suburb” appear in the Weather Sources list. Tap on “OK” in the upper right of the screen to return to the main options screen. Repeat the above procedure to load “WeatherChan_PC.tpl”
FINDING YOUR CITY:
The Weather Channel uses two search tools to find a city, one called “PC Search” and the other called “Suburb ID”. Depending on the town or city you are looking for, one of the search tools will be used. Open up your desktop web browser, and go to “http://www.weatherchannel.com.au”. Then, using the search tool, enter your town or city. For this example, Melbourne will be our search topic. Click “Search” and you will be redirected to the search results page. On this page, there are a number of search results displayed. We are interested in “MELBOURNE VIC 3000”, so click on this link to display the forecast for Melbourne. When the forecast is displayed, take note of the information in your browser’s address bar. Mine has the following:
“http://www.weatherchannel.com.au/Magic94scripts/mgrqispi94.dll?APPNAME=WC&PRGNAME=WC&LayGroups=&SearchFor=&Function=SuburbForecast&SuburbId=5418&WeatherMaps=0&=0&Leisure+Reports=0&=0”
This gives us all the information we need to use our scripts. Pay attention to the fragment: "&SearchFor=&Function=SuburbForecast&SuburbId=5418”. Here, our Spb Weather city code is 5418 and the script we should use is WeatherChan_Suburb.tpl, from the fragment “Function=SuburbForecast”. Another example is for Mt Perisher, in the Snowy Mountains of NSW. Go back to the homepage, and enter “perisher” into the search box, and click on “Search”. The weather forecast for Mt Perisher is then displayed. The information in the address bar will be:
“http://www.weatherchannel.com.au/Magic94scripts/mgrqispi94.dll?APPNAME=WC&PRGNAME=WC&LayGroups=&SearchFor=perisher&Function=PCSearch&SuburbId=&WeatherMaps=0&=0&Leisure+Reports=0&=0”
This time, our city code is “perisher” (all lowercase!), and the script to use is “WeatherChan_PC.tpl”, from the search function PCSearch being utilized.
ADDING YOUR CITY:
Now that we have all the information to proceed, go back to the Spb Weather options screen, and tap on “Add…” At the bottom left side of the screen, tap “Custom”.
Then enter the name of the city – in this example it is Melbourne. Enter the city code details and select “WeatherChan_Suburb” as the weather source. Click on “OK”, and then exit the options screen. Depending on how you have the refresh intervals configured. You may need to force Spb weather to refresh your data. Once the data has been downloaded, you will see the four day forecast for Melbourne.
WHY DO I SEE ONE OR MORE ICONS DISPLAYED AS “N/A”?
I have only managed to map a handful of icons used by the Weather Channel to those used by Spb Weather. The purpose of this section is to describe how to map new icons, so Spb Weather will display them correctly. Continuing from the Melbourne example, there is a new icon for the 10th of April 2005. From your desktop computer browse to the “WeatherParser_log.txt” file, located in the root directory of your Pocket PC. Copy this file across to your desktop computer, and open it with NotePad. Then do the same with “WeatherChan_Suburb.tpl”. In this example, the sky icon found for today is “02_windy”, and displays as “N/A”. The mapping table in
“WeatherChan_Suburb.tpl” is shown below:
// Mapping declarations and definitions.
// Not all sky .gif images have been mapped at this stage.
// You will need to add the other mappings as they appear as "N/A"
// You can consult the "WeatherParser_log.txt" file for the icon names
// that display as "N/A".
map skyMap
{
key_value("01_cloudy", "4");
key_value("03_partly_cloudy", "3");
key_value("04_fine", "2");
key_value("10_few_showers", "14");
key_value("12_showers", "7");
key_value("07_rain", "8");
key_value("06_thunderstorm", "13");
key_value("05_drizzle", "14");
key_value("11_fog", "3");
};
You will see that “02_windy” is not there, and since there are no icons for windy weather in Spb Weather, an icon will be chosen based on the forecast for the day. This forecast is taken from the web site and is below:
Sunday
Fine and warm to hot with fresh to strong northerly winds then a cool southwesterly change extending from the west during this afternoon with patchy rain and isolated thunderstorms to follow.
An appropriate icon would be partly cloudy. See the icon table at the end of this document for all available icons used in Spb Weather. Please note that this table has been taken from the Spb document “Spb Weather Source Template Manual”, which can be downloaded from the Spb web site.
// Mapping declarations and definitions.
// Not all sky .gif images have been mapped at this stage.
// You will need to add the other mappings as they appear as "N/A"
// You can consult the "WeatherParser_log.txt" file for the icon names
// that display as "N/A".
map skyMap
{
key_value("01_cloudy", "4");
key_value(“02_windy”, “3”); <- Partly Cloudy icon = 3
key_value("03_partly_cloudy", "3");
key_value("04_fine", "2");
key_value("10_few_showers", "14");
key_value("12_showers", "7");
key_value("07_rain", "8");
key_value("06_thunderstorm", "13");
key_value("05_drizzle", "14");
key_value("11_fog", "3");
};
Once edited, save the file. Open “WeatherChan_PC.tpl” and update the mapping table as before. To use the updated templates, de-select any cities using these, and remove them from Spb Weather. Then add the new templates using the procedure outlined above. Refresh your weather data, and all icons will appear on your today screen.
Enjoy!
Recrem.