[ Content | Sidebar ]

Sydney Traffic

Results of a little bit of weekend hacking…
http://twitter.com/sydneytraffic

It parses / screen scrapes the Sydney RTA’s traffic reports, does some text substitution in an effort to get the event text under the twitter 140 character message limit and automatically posts the updates. The idea is that one could then subscribe to sydneytraffic on twitter and receive SMS updates of the latest traffic situation.

Strangely, the RTA don’t provide an XML / RSS / Atom feed or anything sensible for these updates, so it was a bit of a challenge to strip out the relevant information from the table heavy HTML. I’m going to continue making improvements and updates to the text substitution and shortening, but it’s basically functional now.

UPDATE: Source at http://bitbucket.org/akent/sydneytraffic

18 February 2008

14 Comments

Write comment - Trackback

  1. Comment by Julian Ridden

    Brilliant stuff! Hate to think how much work this took, but it certainly seems to work well at this point. Ill keep checking back here for updates.

    11 September 2008 @ 9:02 am

  2. Comment by josh909

    Just stumbled across this… Great work! It’s disappointing (though not surprising) that organisations like the RTA don’t have the initiative to do this themselves. Again, top work!

    01 October 2008 @ 8:37 pm

  3. Comment by Dean

    Just found this aswell, and loving it!

    Any chance of using your methods to report on cityfrail disruptions?

    31 December 2008 @ 7:28 am

  4. Comment by Adam Kent

    Dean (and all) thanks. For Cityrail there is http://twitter.com/sydtrainservice … More info here.

    31 December 2008 @ 7:55 am

  5. Comment by Kelvin Nicholson

    Interesting little project! It would be pretty cool if there was a service that allowed you to lookup coordinates via street addresses, and you could do a daily map of incidents.

    Anyways – as there aren’t any XML feeds to consume, are you just scraping the page with BeautifulSoup (or something else)?

    Nice work!

    13 January 2009 @ 9:36 pm

  6. Comment by scatsboy

    Just found this – interesting.

    We’ll see what we can do to make this info a little bit more accessible.

    We’ll also keep an eye on this forum for your comments and suggestions.

    No promises (of course), but we will consider your thoughts.

    25 March 2009 @ 12:07 pm

  7. Comment by Phil

    Great service. Amazed at home many incidents there in any one day. The downside of which is the feed overloading my twitter account.

    What’s the possibilty of segmenting the information into seperate feeds? CBD, North Shore, Inner West etc…

    Currently I feel like I’m suffering from Too Much Information™

    15 April 2009 @ 1:02 pm

  8. Comment by Adam Kent

    Hi Phil. I agree, the number of daily incidents is quite remarkable. You might be interested in checking out the separate “area” feeds:

    http://twitter.com/sydtraffic_city
    http://twitter.com/sydtraffic_nth
    http://twitter.com/sydtraffic_sw
    http://twitter.com/sydtraffic_nw

    15 April 2009 @ 1:08 pm

  9. Comment by abe

    Great idea!

    Did you guys have to ask permission from the RTA to reproduce their content..?

    27 May 2009 @ 3:03 pm

  10. Comment by Adam Kent

    @abe: I have not asked the RTA for explicit permission, no, but I think scatsboy above in comment #6 is somehow affiliated with the RTA so I’m taking that as implicit tolerance. Also there are a few other sites that seem to use the same data, check out http://prangz.com and http://www.traffichawk.com.au

    27 May 2009 @ 7:46 pm

  11. Comment by Adam Kent

    Belatedly @scatsboy, thanks for the feedback. When the data format changed in June 2008 that made life a lot easier. To be honest, the screenscraping solution is working pretty well right now, so I’m disinclined to change what’s working, as long as the RTA is happy with the bandwidth overhead! I try to be quite polite with the polling though, only every 5 mins in peak hours and every 20 minutes other times.

    27 May 2009 @ 7:49 pm

  12. Comment by Dave

    Also a heads up on http://snarl.com.au. Launching this week. Starting in Sydney and moving all around the country.

    05 June 2009 @ 12:19 am

  13. Pingback from Bus and car meet on George and Liverpool | Leefe rates the world...

    [...] Can’t seem to find any mention of the incident on the RTA Sydney traffic reports. Which, I find, have been usefuly turned into twitter feeds: [...]

    15 June 2009 @ 10:07 pm

  14. Comment by Jan

    Are you able to incorporate information from non RTA sources? Would be interested in knowing how to send you any urgent updates on major roadworks happening now on Hills M2 motorway. Would appreciate a response via the email address provided. Twitter address is HillsM2Roadwork

    30 July 2009 @ 10:47 am

Write comment