Very similar to the Google Gadget, there is a single URL that anyone can point their browser at to view real-time arrival estimates for any two stops in the Metro system.
https://smsmybus.com/kiosk?s=0100,0161&d=WORK,HOME
The two, four digit numbers after the 's=' string in that URL indicate the stop IDs to display. The two direction labels are optional, but if you include them, order matters. They should correspond to the stops listed.
Enjoy!
Well, last week, that satisfaction blossomed into gratification when I learned that the University of Wisconsin had included the SMSMyBus API in the latest version of their app released for the 2011 academic year. Now students using the app can get real time bus arrival estimates throughout the city rather than relying on the fixed schedule right from their iPhone and Android devices.
Mostly because this is exactly the kind of application that can get the attention of the Metro and the City of Madison as an example of what can be accomplished if more public data becomes accessible in an easy to consume (programmable APIs) interface.
Super proud.
When the real API was produced, the goal was to replace those legacy implementations with native API implementations. That's now been done and rolled out to all of the various businesses deploying a kiosk. You can see the Mother Fool's kiosk here and the Sector67 kiosk here.
If you'd like to deploy your own, feel free to use these as a starting point. They are good examples for consuming the API in JavaScript. You can find the example code on the github repo - https://github.com/gtracy/smsmybus-dev. Enjoy!
So with the help of a little XML, JavaScript and of course the API, you can now get bus arrival estimates for your favorite Metro stops alongside your chat sessions and gmail folders! This post provides some instructions for adding the gadget.
1. Open up your gmail settings.
2. Select the 'Gadgets' tab.
3. Add the XML path of the gadget to the text field using the desired stop ID number in the URL path. For example, for the eastbound stop outside of Trader Joe's, I would add, https://www.smsmybus.com/gadgets/metro/2749.xml
To specify a different stop, just replace '2749' with your own four digit stop ID. And don't worry, you can always check other stops from inside the gadget once it loads.
That's it! Interested in changing this? I've posted the xml on github if you'd like to use it as a starting point - https://github.com/gtracy/smsmybus-dev.