Dawn: Mobile bus stops display

14 Jul 2016

Rust  Web 

Originally posted at https://tech.labs.oliverwyman.com/blog/2016/07/14/dawn-mobile-bus-stops-display/

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.

Dawn 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.

Previously: Docket: Fun with Todoist and Beeminder APIs Next: Using the BBC micro:bit with PlatformIO