Wired Living

Sunday, 18 March 2007

XPL Script: Sending Status Messages to Twitter

I stumbed cross twitter a couple of months back, and didn't think much of it.. I thought i'd just leave it to the MySpace teens to play with... Who really wants to know what i'm doing at any waking moment? (well besides my gf :o) )

Then I came across Gordon Meyer's Post on using Twitter to send status messages to his phone, email, web, widget..




BRILLIANT... Now I don't need to code something myself!.. I could even work the above widget straight onto a touchscreen interface!

So here it is.. An quick XPL script I wrote to basically relay OSD messages to a nominated Twitter.com account..

What it Does
  • Piggy-backs of another OSD device and relays the message via http get to a Twitter account.

How to Install it

  • Download the script and save it to the scripts folder (or create a new user script and cut & paste the code in)
  • Change the user/password variables in the script to your own (well hour house's)
  • Add a trigger to the device you want relay messages from (eg device script: Slimdev_Slimserv_slim1.xpl)
  • Send an OSD message to that device and whalla - Twittered!

Enjoy!

Labels: ,

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
  • 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)
How to Install it
  • 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: ,