This is a Dashing widget that shows the upcoming departures of selected stops in the Helsinki region. It relies on the HSL HTTP GET Interface.
To use this widget, copy hsl.html, hsl.coffee, and hsl.scss into the /widgets/hsl directory. Put the hsl.rb file in your /jobs folder.
You will also need to set up your HSL API credentials as environment variables (HSL_USER
and HSL_PASS
), alternatively you can hard code them in the hsl.rb file. Get the credentials here.
Finally, replace the stop ID's in the stops
array in hsl.rb with the stops you want to follow, and include the following tag in your dashboard (.erb) template:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="2">
<div data-id="hsl" data-view="Hsl"></div>
</li>
Note that this widget is intended to be used with the Lato Google Web Font, and styling may need fixing for use with other fonts.
Besides changing what stops you want to follow, you can also set a time limit for how long it takes to walk to the stops. Usually, you don't want to see buses and trams leaving right now, as you can't possibly catch them. The default is 2 minutes, but you can change this by modifying the time_limit_minutes
variable in the beginning of the hsl.rb job.