Dawn: Mobile bus stops display

By: on July 14, 2016

When I’m out and about, I find myself repeatedly wanting to know when a bus will stop near where I am. This generally involves a phone as the TfL Countdown displays are a bit thin on the ground. Despite the advent of such things as Citymapper, I’ve still been a fan of the Countdown mobile website, so of course TfL are shutting it down… On the other hand, they have folded all the features of that site into their main site, but that’s a pain to navigate, especially on a “not really 4G” mobile connection. Luckily, they’ve done a bunch of improvements to their APIs so they’re now actually usable (and despite their claims, you don’t need an API key for most of it), so I can build a replacement.

2016-07-06 18.46.51Dawn is intended as a mobile-friendly bus stops finder. By mobile-friendly, I don’t just mean you can view it on a mobile screen without squinting too much, I also mean I took into account the dodginess of mobile connections and the variable state of phone processor capabilities. To that end, it has no CSS, no images, the only Javascript is 20 lines of Vanilla JS-compliant code on the search page (and that’s only for the geolocation bits), and so every page request requires literally *one* HTTP call from your browser. It’s all written in Rust with no database backend, so pretty much the major slow point is waiting for TfL’s API (and to be fair, that’s pretty speedy). It also supports saving of favourite stops (via server-side manipulation of cookies), as well as search by name or Countdown Bus Stop Code (those 5-digit codes on bus stops).

This does all mean it looks pretty minimalist, but it is very, very fast. In theory it should even work on feature phones (although I haven’t got one to test with). Heck, it works on Lynx, it should be good with most things! Source code is as always, available.

8 Comments

  1. Graham Bird says:

    Dear Tom,
    Thanks very much for developing this. You are a hero!
    TFL seems to have abandoned web users (as opposed to app users). Their replacement for their old m.countdown application is simply not fit for purpose. You’ve understood what is required and have delivered it. It’s very fast on my old Blackberry 9900. Thanks again.
    Graham.

  2. Kareem Osman says:

    Just saw your blog post.

    Thank you! This is exactly what is needed since TfL shutdown the m.countdown.tfl site.

    Any chance of future updates by being able to search by bus route?

  3. Tom Parker says:

    @Kareen: Not planning on it, no, as I’d have to think a lot about how to fit that in with the existing design. OTOH, https://api.tfl.gov.uk/ does have a “search by line” feature, so it could be expanded to give you data about a line.

    Searching for say, stops in a geographical area (e.g. nearby) that have a particular line is slightly useful, but then you’d probably also want a map or other location data, and trying to fit that in while keeping in mind the existing low-bandwidth aims would be quite hard. Happy to accept patches to the existing codebase at https://github.com/palfrey/dawn if anyone’s got some bright ideas, but that’s not something I plan on building myself.

  4. Stephen Hsu says:

    Dear Tom, thank you so much. Unbelievable how moronic and insensitive TfL can be. With your genius you have singlehandedly repaired all the damage that they caused. Steve

  5. Tim Williams says:

    Hi there – I’m a developer on TfL API – great job! And glad you like what you see. I would highly recommend getting an API key though, you will hit a quota limit pretty quickly without one!

  6. Colin Newman says:

    Hi – nice, but when I type in ‘Barking Station’ it goes straight to ‘Barking Station stop H’. It should really match all the stops called Barking Station [something] and probably treat them as if they were all one bus stop – people aren’t necessarily going to know which particular one they want.

  7. Tom Parker says:

    @Colin: Hmm. That’s an actual bug. There’s a bit of magic code that should identify searches that only return single results and automatically bounce you to the single stop that’s the result, but for some reason it’s doing that for Barking even though there’s multiple results (or certainly there is on the actual TfL website). I’ve just opened up a new ticket (https://github.com/palfrey/dawn/issues/15), and should eventually get around to looking at it.

  8. Tom Parker says:

    @Colin: That now does the right thing. Thanks for the report!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*