After seeing SiriProxy in action on YouTube, I was keen to grab an iPhone 4S to have a play with it. I managed to pick one up at the Apple Store yesterday and today I'm pleased to release my first SiriProxy plugin; TubeUpdates. It's a basic plugin that lets you ask Siri for the status of a London Underground line thanks to my TubeUpdates API.
I've not dabbled with Ruby for a while but building the plugin was fairly straightforward. All of the code is available on GitHub but the main piece looks like this:
The matching in the first line ensures that you can ask either "what is (or what's) the status of (the line name)". This is then url encoded and "the line name" is sent to a Siri endpoint I created on the Tube Updates site. The site will return a JSON string of the tube line status which is then parsed and spoken back to the user. E.g. "The Circle line is running a good service".
If there are any messages for the line (these are generally details of delays), then an additional step is performed; the user is asked if they would like to hear the details and answering "yes" will list them.
And that's pretty much it! I've got a few ideas for more complex plugins that can interface directly with iPhone apps so I'll have a play with those when I get a spare moment. If you've got any comments or feature requests for this plugin, then get in touch.
As an aside, this is the first project I've published that is written in Ruby and the first time I've put anything up on GitHub.