All Projects â†’ danielthepope â†’ trntxt

danielthepope / trntxt

Licence: MIT License
🚂🚋🚋 A data-friendly UK train times site

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Pug
443 projects
CSS
56736 projects
Dockerfile
14818 projects
Makefile
30231 projects
HTML
75241 projects

trntxt

Build Status Dependency Status

trntxt icon

Pronounced "train text" and currently live at trntxt.uk, this is a GPRS-friendly web service that provides train times for stations across Great Britain.

(Also lives at traintext.uk, but that's not as cool)

Uses the National Rail 'Darwin' API to get departure times.

Usage

trntxt currently gives departure times for a given station, optionally filtered by a calling station.

Stations can be input using either their 3-letter codes or by their names (without spaces). For example, 'bristolparkway', 'bristolp' and 'bpw' will all give times for Bristol Parkway.

Examples

  • /pad: Departure board for London Paddington
  • /swindon: Departure board for Swindon
  • /bth/cardiffcentral: List of trains from Bath Spa that call at Cardiff Central

Contributing

Thanks for helping out! Please feel free to fork this repo, make your changes then make a pull request.

This program will run on Node 8.

Install the required packages using npm install in the command line.

Transpile the source code using npm run build.

You will need to register for a National Rail API key here.

Once you have a key, paste it into ./config/config.yaml, overwriting the default value for API_KEY. config.yaml is created when you first run npm install.

You can run the program using npm start. This will lsten on port 3000 by default, so you can visit localhost:3000 on your browser. If you want to use a different port, set the environment variable PORT. You can do this in Bash by running PORT=12345 npm start. Otherwise you can overwrite the default value for PORT in config.yaml.

While developing, you might find it useful to run npm run develop. The server runs, then restarts/rebuilds if any of the files are changed.

To do

There are still a few things I'd like to do with trntxt. Check out the issues page for things to do. If you want to tackle a particular issue, let me know first in a comment or on Twitter - I might be working on it already!

Acknowledgements

There are a number of people I'd like to thank for helping me out throughout the development of this project. The contributors page doesn't tell the whole story, so here we go.

  • Tom Lane, for giving a talk about Open Rail Data, planting the seed for this idea;
  • Rikki Tooley, for first suggesting the idea of dynamically generated app icons;
  • Alex Birch, who helped me set up a much better way of managing the configuration files, and who submitted the first pull request to this project. However I completely mullered the PR so he didn't appear on the contributors page (sorry!);
  • Marcus Noble, for solving an issue I had raised just a couple of hours before;
  • My brother Kieran (who doesn't own a GitHub profile - yet), who was my guinea pig for much of my Android testing;
  • Jamie Greef, for his enthusiasm and for the quote "It just works";
  • Tom Wright, who helped me set up Mocha so I can prove Jamie's statement;
  • And to Jeff Schomay, who although didn't contribute to the project directly, he organised the first Bristol Hack Nights, giving us developers a sociable space for us to work on our projects.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].