Between watching the two grand finals this weekend (boring matches, but awesome results for Victoria
), I managed to get some time to start poking around with Python, a programming language. And what better way to learn something than using it to tackle a pet peeve. So I wrote a python script that extracts timetable data from the Metlink website, and into an XML format. The reason? So I can get Metlink timetables on my phone, so I don't get to the station just as a train's leaving, because crappy Metlink doesn't offer mobile-friendly access to their timetables, or downloadable versions. More on Metlink's web annoyances and improvements here.
Python's definitely growing on me - I can see how it can be more productive. The interactive console is great, but I still have to work out a better way to debug my programs. I was surprised that it didn't have inbuilt support for XPath though - it's a pretty common inclusion now. Luckily there are a few modules out there that can do this - the best one in my opinion being lxml, which I used. I can see a place for it in my toolbox, especially for putting together some quick scripts.
Anyway, here's the link to the project page with all the details on it - http://driveactivated.com/projects/pages/metlink-timetable-downloader.aspx.
Like I said on that page, I'm hoping that with access to the timetable data, people can start doing some stuff with it, some kind of mash-up. I'm personally going to rig up a nicer and friendlier desktop and mobile app when I get time, because I think it could really do with one. Maybe later I'll write a script to get the service updates information, and interface with the search and journey planner tool too. Better not do it too soon though, don't want to make it too easy for people to use public transport because it's already overloading now
.
Anyone got some cool ideas with what to do with the Metlink data?