NextBus Python Script
This will be useful to almost nobody, but someone on SFist asked about it, so here it is.
This is a Python CGI which grabs and parses the XML bus prediction data from NextBus.com for the San Francisco Muni. I wrote it so I could have easy mobile access to certain bus lines (including my beloved 21-Hayes) for which data wasn’t otherwise easily accessible. It doesn’t work for that anymore; it only works for bus lines for which the data is easily available on NextBus.com. (Apparently the rest of the bus lines will be available soon.)
Anyway, this is likely to be of some use to people who want to do cool SOAP web services stuff with the Muni bus prediction XML data. Right now it’s a CGI that provides a really light fast web interface for the prediction data, but it could pretty easily be hacked into a command line prediction script or a widget or a much slicker web interface. It’s licensed under CC-BY. Here it is:
1 Comment
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.

RSS Feed
yeah! this is cool. getting the session cookie set is the trick to loading the xml…
the neat part about the XML data is it includes gps coords of all the busses on the route..
Comment by skot — 6 March 2007 @ 00:02