Install Your Own Network Rail Train Delay Excuses Generator On Your Own Website!

This widget has various advantages over attempting to use the official National Rail API, such as: you can install it without any fucking around with registering and licences and all that fucking shite; it is completely self-contained, does not connect to any server other than that of the hosting website and does not support or facilitate the harvesting of personal data; and it is often more informative. It uses the official Network Rail list of excuses for train delays and permutes them using advanced stochastic techniques* to generate an output tuned precisely to the user's state of mind; if, despite this, the user still feels inadequately informed, they can simply request further excuses until they get one they can believe, so satisfaction is guaranteed.

Installing the widget is simplicity itself; it goes like this:

  1. Download the script: train-delay-excuses-2.js and upload it to your server.
  2. Add a SCRIPT tag referring to the script in the HEAD section of the page you wish to embed the generator on, ie. <script type="text/javascript" src="train-delay-excuses-2.js"></script> with the path adjusted to suit your configuration.
  3. Add an empty <div class="excuse_container"></div> to the page wherever you want the generator to appear. The source of this page, of course, provides an example. You can repeat this, and have multiple generators on the same page, if you really want to. They come out looking like the one above right. Edit the CSS near the beginning of the script to change this, at your own peril.
  4. Alternatively, or additionally, use the window.traindelayexcuse() function, which takes no parameters and returns a string containing an excuse, and devise your own means of displaying its output. The ticker below is implemented using this function. Have a look at the page source to see how it works.

And that's it. Share and enjoy!

*ie. I wrote it, but I can't understand what it does any more.




Back to Pigeon's Nest


Be kind to pigeons




Valid HTML 4.01!