This is a Dashing widget to display train service times and disruptions on a Dashing dashboard.
Make sure you add the ns-api gem to your Gemfile:
gem 'ns-api', git: 'git://github.com/marceldegraaf/ns.git', require: 'ns'
Follow the instructions to request your NS API credentials and set these in the Train class - or use the ENV vars that are already present there.
Add the widget to your dashboard:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="ns" data-view="Ns" data-title="Train info"></div>
</li>
In the jobs/ns.rb file there is an example of data retrieval for the Dashing widget. The Train class is responsible for interacting with the NS API gem in this case, but you could easily move this code into the job itself.