Upgrades: adding directions, destinations and more
So, @whensmyDLR 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 - the DLR is complicated 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 @whensmyDLR has been upgraded to work out directions and destinations. So you can now go:
@whensmyDLR DLR from Limehouse to Gallions Reach
@whensmyDLR DLR from Limehouse Eastbound
And the bot will look through all the DLR trains from Limehouse, work out which ones are relevant to you and filter accordingly (so in the above examples, the first would only return trains to Beckton, and none to Woolwich Arsenal, 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 West India Quay or W India Quay or West India Q?) 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.
No need for a line name
To save you a few keystrokes, @whensmyDLR will assume you’re talking about the DLR even if you leave the line name out, so Tweets like this:
@whensmyDLR from Shadwell
Will work just fine.
Comments welcome - just ping them my way @qwghlm