danielthepope / trntxt

:steam_locomotive::train::train: A data-friendly UK train times site
https://trntxt.uk
MIT License
36 stars 9 forks source link

Create an API #48

Open danielthepope opened 6 years ago

danielthepope commented 6 years ago

Make a simple REST API that returns the same results that trntxt the website returns, but in a parseable output. Suitable for use in RenderHack 2018

nullpixel commented 5 years ago

would this be open? seems like you have it behind a secret in that commit

danielthepope commented 5 years ago

Hi, the API is open at the moment (I uncommented the verification bit for RenderHack then never put it back), but I don't plan on keeping it open or supporting it long-term. What are you planning to do?

nullpixel commented 5 years ago

at the moment, i don’t have a specific plan/use case for it — it just seems pretty nicely done and could potentially come in useful for some projects. i may end up writing a iOS app for trntxt if that gets interest though.

danielthepope commented 5 years ago

If it's a solid REST API you want, you might be better off with something like Huxley: https://huxley.unop.uk/ You can self-host a Huxley so you can make it as reliable as you want it to be. I've not tried it properly myself but I'm pretty sure it contains more information and endpoints (I'm only looking at /departures).

nullpixel commented 5 years ago

ooh, thanks for sharing that. that looks like a great wrapper around the horrible NR APIs!

danielthepope commented 5 years ago

SO HORRIBLE. Trntxt is using OpenLDBWS, which isn't even compliant SOAP, so I'm locked to a really old version of the node-soap library to make it work. National Rail provide Historic Service Performance (HSP) as an API too, which I haven't looked into at all, but it might be better for what you want to do. http://www.nationalrail.co.uk/100296.aspx

nullpixel commented 5 years ago

OpenLDBWS put me off doing anything with the NR API which is why I was pleasantly surprised to see this awesome project open-sourced :)