Wednesday, 13 July 2016

Arrivals just arrived to @london_tube_bot



After some more fiddling with @london_tube_bot I figured a feature I really need for myself: as I often run to the timetable, I need a way of quickly checking when is my next train due at my station. Naturally, I decided that I had to add it to my bot. And boy, was it an interesting journey ...

The problem as I see it is that TfL's API inherits their data model, which, in its turn, inherits their complex relationship with different train operators. Did you know, for example, that Kew Gardens is not a station, but, in fact, two stations located exactly at the same place - Kew Gardens London Underground station, and Kew Gardens National Rail station? And yes, if you want to fetch arrivals from this station, you will have to do it separately from these two. More interesting: from TfL's perspective there's no Tube on this station - just Overground and National Rail. That probably makes District Line a commuter train somewhere half the way.

Anyway, here it is, enjoy!