What is @whensmytube?
@whensmytube is a Twitter bot that tells you what time London Underground (Tube) trains are arriving at a station near you, based on your location and TfL’s real-time data. I’ve just launched this so consider it to be in beta
Awesome. How do I get train times?
The easiest way is, if you have GPS-enabled smartphone like an iPhone or Android phone. Just make sure you have your current location added to your Tweet - instructions on doing so are here. Then just Tweet the name of the line you want to @whensmytube, e.g.:
@whensmytube Central Line
If you don’t have a GPS-enabled smartphone, or prefer not to disclose your location, then you can include “from [stationname]” where, [stationname] is the name of your station, e.g.:
@whensmytube Central Line from Liverpool Street
@whensmytube will work out where you are and within a minute Tweet back at you the next three train departures in each direction for that :
@qwghlm Liverpool St to Epping 1500, 1506, 1508; Ealing Bdwy 1501, 1506; W Ruislip 1503
What’s better, GPS or non-GPS?
The GPS version, it’s sexier. Seriously, it will be more accurate - there’s always a chance you’ll spell the station name wrong, or it will be ambiguous. @whensmytrain will try its best to find the name matching your station, but it will find mis-spellings or abbreviated names a bit of a pain.
Are there any limitations?
Unfortunately, TfL don’t provide live data for every single station on the network, and some stations this simply doesn’t work for (complain to them, not me!). They are:
Hammersmith & Circle Line: Goldhawk Road, Latimer Road, Shepherd’s Bush Market, Wood Lane
Metropolitan Line: Chesham, Preston Road
Isn’t this pointless? Don’t TfL offer the same information as well?
TfL do offer the same information, on the web (for free). But I found the mobile web experience a bit fiddly, and this Twitter bot does stuff like clean up odd destination names and confusing terms like “Outer Rail” into something more human-readable.
I’d like to use @whensmytube but I don’t like giving away my location. Can I send it a direct message instead?
Yep, you can send Direct Messages to @whensmytube as well. You first need to follow it, then it will auto-follow you back within a few minutes. Once you’re both following each other, you can send it a Direct Message. However, you cannot add your GPS position to a Direct Message (Twitter’s rules, not mine), so you have to specify your departure point in your Tweet, e.g.:
d whensmytube Central Line from Liverpool Street
Can I specify more than one line at once?
Not yet, I’m afraid, although that will be available in a future release.
I’ve added location to my Tweets but it’s not working!
This can be a point of confusion: Twitter offers the option to add a default “Place” to every Tweet you make (e.g. “Westminster, London”) via the website or via desktop apps such as Tweetdeck. However these Places are not your exact GPS location and they are too vague for @whensmytube to work out exactly where you are; for example, “Westminster, London” covers virtually all of Travelcard Zone 1.
This Place info (via the web, or on a desktop app) is not to be confused with adding your exact location via GPS (on your mobile). At the moment, Twitter doesn’t allow you to provide detailed GPS-quality location information from the Twitter website or desktop apps, alas.
I want to ask it several times during the day, but Twitter doesn’t like me making duplicate Tweets
Put a random hashtag at the end of your Tweet after the route number to make it unique; the bot will ignore all hashtags and let you ask for the same station and line multiple times.
Who are you, and why did you create this bot?
I’m Chris Applegate, and I’m a hacker and transport geek based in London.
How did you build this? Is the source code available?
I built this with TfL’s data API, co-ordinate conversion code from Chris Veness and the help of the Tweepy library. The source code is available on github.