TL;DR: I made trntxt.uk, a data-friendly train times website.
Over the past few weeks, I’ve meed putting a little bit of my free time into developing a train times website.
The idea came to me after a JSOxford talk by Tom Lane about open rail data. It turns out that the data you see on train station departure boards is all accessible, so long as you register for a free API key.
I decided that the reason why the train times app on my phone wasn’t working was because the data was taking too long to arrive over a 2G connection, so I thought I would try and speed things up a bit. I’d make a website without using anything unnecessary, and in doing so I’d have a website that works well on whatever device you’re using.
I call it “Train Text”. It works like this. Let’s say you’re at London Paddington and you want to find out when the next train to Bath Spa is.
You would point your phone’s browser at trntxt.uk/paddington/bathspa. You don’t need to use the full name of the station – just use part of the name and trntxt will probably find it. Just ignore spaces or any other punctuation. If you know the 3-letter station codes, you can use those too and save some typing time in the process (trntxt.uk/pad/bth). trntxt makes these station codes visible to help you remember them.
The website was designed so that even my old Nokia 6303 can access it correctly on a slow 2G connection.
I’ve stripped out everything unnecessary so that you can get the fastest responses possible (more on that in another post). That’s why it doesn’t look very good 😛
There are, however, some limitations. One of them being it can only handle direct routes. If you’re traveling from Swindon to Oxford, you need to change at Didcot. You’ll need to make a request for Swindon to Didcot, then another from Didcot to Oxford.
It doesn’t do arrival times yet, but I’ll get them in soon!
What’s more annoying is that after I made the site, I realised that it seems to work everywhere apart from Bath Spa station.