jpsingleton / Huxley2

A cross-platform JSON proxy for the GB railway Live Departure Boards SOAP API
https://huxley2.azurewebsites.net
European Union Public License 1.2
51 stars 74 forks source link

Station list CSV down #2

Closed davwheat closed 3 years ago

davwheat commented 3 years ago

https://github.com/jpsingleton/Huxley2/blob/dd82d79012d3a6751c403bf11d50284d0b41e5c9/Huxley2/appsettings.json#L25

This URL seems to be dead. Is there a way to disable the station CSV list update, or a place to change the URL to?

davwheat commented 3 years ago

Ok, I compiled a replacement CSV here: https://gist.github.com/davwheat/5c4522f048da53ada8adc9af5a8fb508

Use this URL as an app setting: https://gist.githubusercontent.com/davwheat/5c4522f048da53ada8adc9af5a8fb508/raw/af8852aacbfa20ed3dc32dd6a19af4d084c1a86f/station_codes.csv

jpsingleton commented 3 years ago

Thanks!

The preferred method of getting the CRS codes is from the staff API. If you set a staff API key then it will be used and the station CSV list update will be disabled (if the staff API call succeeds). The logic is in the CrsService if you want to tweak it.

The file appears to have moved to https://www.nationalrail.co.uk/station_codes%20(07-12-2020).csv but the format has also changed (multiple columns). Good idea to have your own copy that you control, ideally populated from the Darwin staff API. The NRE CSV has previously been incomplete and contained CRS codes that didn't even work with Darwin!

jpsingleton commented 3 years ago

The gist appears not to have a header row and has a duplicate of OKE.

I've produced a complete CRS codes file (https://raw.githubusercontent.com/jpsingleton/Huxley2/master/station_codes.csv) and set this as the default URL in the Huxley2 app settings.

Instructions on how to make it with one line of bash are in the readme.