Messing with the National Rail API
Python JavaScript HTML Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
tests
twitterrail
ui
utils
.gitignore
LICENSE
README.md
loadstations.py
rail.fcgi
railcollector.py
railserver.py
twitterrail.py
twitterrail_lambda.py
twitterrail_lambda_build.sh

README.md

National Rail

There are many parts to this repo, doing simple things with the National Rail SOAP API. Feel free to use bits and bobs as it suits you, with attribution of course!

  • A script to tweet live train information can be found in "tweetrail"
  • Scripts to collect and store data are in "collectors"
  • An AngularJS departure board can be found in "ui/departure-board"
  • A map app showing live routing animations can be found in "ui/route-map"

Learn more about the code on my website and/or follow either the Thatcham Train Twitter Feed or me (DanteLore) on twitter:

Live Route Display

Live Departures

Enjoy!

Installing under lighttpd

Clone this repo to your web root and edit some config files for lighttpd.

Add the following to /etc/lighttpd/conf.d/fastcgi.conf (or /usr/local/etc/lighttpd/conf.d/fastcgi.conf if you're on a Mac)

fastcgi.server = (
    "rail.fcgi" => ((
        "socket" => "/tmp/rail-fcgi.sock",
        "bin-path" => "/usr/local/var/www/national-rail/rail.fcgi",
        "check-local" => "disable",
        "max-procs" => 1
    ))
)

And make sure you have FastCGI enabled in /etc/lighttpd/modules.conf