In June 2019, I started a project to investigate the Realtime Trains (RTT) api. I used python as that was the language I was most proficient in. It was initially just a small file getting a station’s departures and displaying them.
I then thought: “Why not create an account to tweet this?” - so I did. Still just a short programme running on my raspberry pi, @SDY_Updates was born. I then added other stations I used frequently: Bedford, Stevenage and St Neots. St Pancras, Finsbury Park and Kings Cross followed quickly afterwards.
It was at this point that I realised that the RTT api wasn’t handling delays very well. I had known about the National Rail Enquiries (NRE) previously and added that into the code, getting the delay data from there. I then realised that I should just use the NRE api rather than combining them.
There followed the first major rewrite of the code to use the data entirley from NRE. It was at this point my raspberry pi was starting to struggle. I first heard about Linode in ad on the Material podcast. 4 free months was the offer so I took it.
Using PuTTY I transfered the code into a linode running Debian (the same software as the Pi) and with a bit of tinkering, it worked! At this point the project had grown from much more than a python script returning the next departures and needed another rewrite.
Rewrite done, I added Holyhead and Peterborough and was able to leave it alone to just run.
But I couldn’t manage it.
I added Huntingdon and Deal and created a master account @StationUpdates. But I then wanted to make all of the station account retweet anything that it tweeted.
After an evening of googling and reading the twitter api documentation I had it implemented and working. But I believe this must have triggered some sort of alert in the back end of twitter.
Twitter started locking the accounts and I’d have to go through and unlock them again. I also lost access to the email for the Bedford account when I reset my phone which meant I couldn’t reset the password. The final nail in the coffin was when I wasn’t able to recieve the texts twitter sent to unlock the accounts.
So after 5 months of enjoyable tinkering, it has become more stress than fun. So after I’ve posted this, I’m going to go to the linode console and turn off the server. I’ve learnt many things working on this project, including when it’s right to stop.
If you’ve followed the accounts and found them useful, I’m sorry. But I feel this is the right choice for me right now. Something you might be interested in is livedepartures.info which I have running on an old tablet giving me ‘at station like’ information. Or UK Departure Boards who produce custom departure boards that you can have in your home.
There are a number of people I should thank for their work in enabling this project:
- The team behind the requests python module
- @ryanmcgrath and @mikehelmick the developers of the twython module
- Robert Clarke the developer of the nre-darwin-py module
- @swlines the person behind Realtime Trains
See you around internet