A widget for the Dashing framework to display live data from National Rail. The widget shows warning messages from stations, if trains are cancelled, or if they are delayed and by how long.
-
You need an access token to use National Rail's realtime API 'OpenLDBWS'. This can be obtained here
-
Copy
national_rail.html,national_rail.coffee, andnational_rail.scssinto the/widgets/national_raildirectory. Put thenational_rail.rbfile in your/jobsfolder. -
Edit the following variables in
national_Rail.rbtoken- Your access token from abovenumRows- The number of rows that you wish to show on your widget. The default is8crs- Your desired station code which can be found here
Place the following code into your .erb layout file:
<li data-row="3" data-col="4" data-sizex="2" data-sizey="1">
<div data-id="NationalRail" data-view="NationalRail" data-unordered="true" data-title="Trains (LHD)" style="background-color: #0f516b"></div>
<i class="fa fa-train icon-background"></i>
</li>
