A widget for the Smashing Dashboard system to display bus arrival times at one or more stops along Chicago's CTA bus routes.
smashing install e0ffa81df3e25171f993b1bc40c91b18
or
- Copy
cta_bus_widget.coffee
,cta_bus_widget.html
,cta_bus_widget.scss
intowidgets/cta_bus_widget/
- Copy
cta_bus_widget.rb
intjobs/
In cta_bus_widget.rb
replace the following:
YOUR_CTA_BUS_API_KEY
with the API key you get at https://www.transitchicago.com/developers/bustracker/YOUR_STOP_NUMBERS
with a comma-separated list of a maximim of 10 stop numbers that can be found by going to https://www.transitchicago.com/schedules/ and looking up your route(s). Note that stop numbers are different for opposite directions.
Add the widget to your dashboard layout like this:
<li data-row="1" data-col="1" data-sizex="3" data-sizey="1">
<div data-id="cta_bus_widget" data-view="CTABusWidget"></div>
</li>
A width of either 2 or 3 usually looks good. If a height of 2 or more is used, the max
variable in cta_bus_widget.rb
can be changed to increase the number of results to fill the space.
Contents of this gist licensed as follows:
MIT License
Copyright (c) 2021 Damien Eversmann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.