Weatherman Display for WebRemote

Weatherman is an excellent weather information app that also has excellent applescript support making it's integration with XTension easy. It also has support for exporting the forecasts for the various increments into the future so that you can create a display similar to this, live updated in an XTension WebRemote page.

with some clever scripting we can even get out the percent change of precipitation and forecasted high and low temperatures for each time period. I will post those scripts below for getting that data and creating this display. Weatherman updates it's data every so often as per your configuration so you should setup a scheduled event in XTension at the same interval so that as there is new data it will show up in XTension.

The script needs some configuration in the form of setting up the units into which you want the data to be stored and the description of a unit to hold the display HTML that will go to WebRemote. The first parameter just holds the name of city as configured in WeatherMan. You'll need 4 units in XTension to hold the rest of the data. “Forecasted High Temp”, “Forecasted Low Temp”, “Chance of precipitation” and a holder unit for the display data “Weather Display Holder” or something similar. That is the unit that you will select in WebRemote when creating the “unit description as html” control to make the display.

The script is long so I'll just link to a download of the text. Create a Global Script and paste the script into it, make sure the units and city are setup properly and run it. Then setup your scheduled event and add the WebRemote control to a page. You may need to restart webRemote as well as XTdb to make sure that the new units show up in them and begin to store data.

Weatherman Script.txt

It occurs to me that you may also wish to pull the forecasted current temp out of the script, I use an external temp/humidity sensor for that but you can alter the script to pull that data out too. Current Temp is just a simple applescript verb and doesn't require the more complicated parsing of the forecast data as these things do.

webremote/weatherman.txt · Last modified: 2013/07/30 12:27 by James Sentman
CC Attribution-No Derivative Works 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0