Upgrades: adding directions, destinations and more
So, @whensmytube launched a few months ago, and I’ve been playing and tweaking with it since. Today I’ve upgraded it with several new and exciting features:
Directions & Destinations
The original version didn’t support directions, or asking for trains to a particular place, which sucked. Adding these in takes a little bit of cleverness - tube lines are complicated (there are circles, and loops, and one bit goes only in one direction) and working out the best route from one station to the next is an interesting problem in itself. Also, there was no open data out there for me to use, so I had to roll my own.
But now, it’s complete, and from today @whensmytube has been upgraded to work out directions and destinations. So you can now go:
@whensmytube Central Line from Bank to Redbridge
@whensmytube Central Line from Bank Eastbound
And the bot will look through all the Central Line trains from Bank, work out which ones are relevant to you and filter accordingly (so in the above examples, the first would only return trains to Hainault via Newbury Park, and none to Epping, while the second would give all trains going east).
Better understanding of English
Another thing I did was beef up the parser that processes the language - humans are complicated, and to make things worse some stations have names which are easy to think of alternate spellings (Is it Kings Cross or King’s X or King’s Cross St. Pancras?) or put the from and to in the wrong order. The bot is now clever enough to not worry about these inconsistencies, which should make it much easier to use.
Filling in the blanks
The original bot always asked for a line name, which people sometimes forgot to provide. To make it easier, I’ve now fixed this so that if the station you are asking for only has one line stopping at it, the bot is now clever to work out that this must be the line you are asking for. So, e.g.
Will give the latest Piccadilly Line trains from Arsenal, because that’s the only line that stops there. Just don’t use it for stations like King’s Cross St Pancras :)
It now does the DLR
There is a separate bot, @whensmyDLR, for the Docklands Light Railway, but as many people consider the DLR part of the Tube, and it appears on the Tube map, I decided to add it to @whensmytube as well. So you can now ask:
@whensmytube DLR from Bank
And you’ll get DLR times!
Comments welcome - just ping them my way @qwghlm