This widget is based on the B-cycle widget. Capital Bikeshare (cabi) is the bike share system operating in Washington, DC. This system is operated by Alta. As far as I can tell, each Alta installation provides their own API so unlike B-cycle, there is not one place to get information about all Alta based systems. Therefore, this widget only works with Capital Bikeshare but should be easily modifiable to work with NYC, Chicago, and other bike share systems operated by Alta.
Like the B-cycle widget, this widget allows users to use the station ID to get the number of bikes and empty docks at Cabi stations.
Copy the files below to their appropriate places or use dashing to do the work for you (dashing install 7794245
).
Also, add the following line to your Gemfile
and then run bundle install
:
gem 'xml-simple'
After installing, just add the HTML below to your dashboard. Please note, all one needs to do is change the data-id
tag to cabi-ID where the ID is the ID of the station you wish to display. To get the station ID, it is usually easiest to search around the Cabi XML.
You do not need to edit any configuration files other that your dashboard's .erb file. This widget "sends" the status of every station found in the XML file download from Capitol Bikeshare. As a result, the startup time for dashing can be a few seconds as the job script parses the XML file.
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="cabi-19" data-view="Cabi" style="background-color:#dc5945;" ></div>
</li>
The icon is from The Noun Project and can be found here. Please make sure it is copied to the assests/images
directory of your dashing installation.