Page 1 of 1

Weather script

Posted: Wed Mar 17, 2004 8:47 pm
by Steve Horn
I'm unclear on whats required on Weather.com to register and basically how this script works. From their site's registration process, it looks like they want a URL to direct the data to. What am I missing? Also, it looks from the script, while editing, that I'd have to supply a Partner ID and key. This is something that they presumably assign, yes?



signed,



confused in Alabama :?

Posted: Wed Mar 17, 2004 10:46 pm
by ScottBot
Steve,



Alan can probably answer this exactly, but I think what you do is:
  • Go to weather.com
  • Click on the "Sign In" link at the top of the screen.
  • Create an account.
  • Weather.com will send you an email with your own personal partner ID and license key.
  • Use the ID and key in the Device.
I think that this could probably be documented somewhere.... maybe right here :wink:

Posted: Thu Mar 18, 2004 9:38 am
by acheslow
Yep, that's pretty much it although when you register I think it has to be from this url:



http://registration.weather.com/registr ... loap/step1



If I remember correctly if it asks for a URL they are just assuming that you will use the weather data on a website and want to know that site's URL. Since you aren't putting the data up on the web you should be able to leave that field blank or make something up.



After registration weather.com will send you a partner ID, partner key, and link to the SDK. Download the SDK and unzip the icons to your drive. Then copy/paste the partner ID and key into the top of the script where it says:

Code: Select all

'	Weather.com partner ID
WeatherComPar = "xxxxxxxx"

'	Weather.com key
WeatherComKey = "xxxxxxxx"
You will also have to configure the following:

Set the DestFolder variable to the path where your weather.com icons are located. This is also where any downloaded images will be saved.

Set the WeatherComZip variable to the postal code of the city for which you want weather data.

Lower in the script you can customize these lines:

Code: Select all

getImage "http://image.weather.com/web/radar/us_atl_metroradar_large_usen.jpg", "W_radar"
getImage "http://image.weather.com/images/sat/regions/southeast_sat_720x486.jpg", "W_sat"


For each call to getImage you pass it the URL of an image and the name of a property in which to store the path/filename of the image where it is downloaded to your drive. The Weather.W_radar and Weather.W_sat properties are already defined in the export but you can manually create additional properties and insert additional calls to getImage.



You use these images in a theme by creating a dynamic image control associated to the same device property that you passed to getImage. For instance to display the radar image you would associate the image to the Weather.W_radar property.



Hope that helps, let me know if you have any other questions.

Posted: Thu Mar 18, 2004 4:33 pm
by Steve Horn
Thanks for the expanded explanation; the URL entry threw me off and I didn't think about making something up... Doooh. :oops: