Simple Dashing widget and job to display driving times of a route. Uses TomTom for free traffic information.
We at platform45 use it to display our driving times home so we know when to leave work to get home to our loved ones in time.
##Dependencies
Uses json, uri and net/http net/https libraries.
##Usage
To use this widget, copy traffic.html
, traffic.coffee
, and traffic.scss
into the /widgets/traffic
directory. Put the traffic.rb
file in your /jobs
folder.
To include the widget in a dashboard, add the following snippet to the dashboard layout file:
<li class="purple" data-row="1" data-col="1" data-sizex="1" data-sizey="2">
<div class="purple" data-id="tomtom" data-view="Traffic" data-title="Home Time"></div>
</li>
##Settings
You'll need to grab your office location and everyone's home address location from tomtom's maps here, and add them as shown to office_location and the location array.
You'll also need to generate a tomtom developer api key, this is free, it just takes 24 hours to activate. Get one here.
##Preview
Hi @jonoeoo,
Sorry to bother you but do you happen to know how to define this array? I'm new at ruby and am having trouble to implement this widget with more then one address, similiair like you.
I now have
Which works, but when I change that to
The widget doesn't show any traffic info anymore.
Could you help me with the proper syntax maybe?
Kind regards,
Michel