XPL Script: Current Melbourne Weather
One of the first things I thought i'd try with XPL is to get some global variables set up.
A good start was some global varialbles to store the current weather. Which will obviously come in handy down the track when I look at HVAC & garden watering systems.
With most XPL development being overseas (UK mainly) - there was nothing specific that i could use.
Anyway I found a script on the XPL Forums which I based this on (only ended up using the concept & a couple of lines - but thanks clinque)
What it does
A good start was some global varialbles to store the current weather. Which will obviously come in handy down the track when I look at HVAC & garden watering systems.
With most XPL development being overseas (UK mainly) - there was nothing specific that i could use.
Anyway I found a script on the XPL Forums which I based this on (only ended up using the concept & a couple of lines - but thanks clinque)
What it does
- Grabs the last weather reading via http from the corresponding city page on The Beurea of Meteorology (ie. Melbourne)
- Locates the first row of readings, and writes values into Globals for Temperature, Wind Direction & Speed, Pressure and Rainfall.
- Sends an OSD message when done (I've got a Slim Devices Squeezebox setup to recieve them)
- Download the script and save it to the scripts folder (or create a new user script and cut & paste the code in)
- Setup globals in XPLHAL Manager
BOM_CURRENTTEMP
BOM_WINDDIRECTION
BOM_WINDSPEED
BOM_PRESSURE
BOM_RAIN - Change the URL if needed (Should work on any of the location observation pages)
- Add "call Weather_Init()" at the end of xPLHal_Load() (in script xplHal_Load.xpl)
- Reload scripts (or restart xplHal) - and the globals should be populated with the current weather & the current temperature should be sent to all OSD devices.
Labels: xpl script, xplhal
1 Comments:
Script updated.. Had a little bug in the original.
By Derrick, At 21 March 2007 at 7:35 am
Post a Comment
Subscribe to Post Comments [Atom]
<< Home