muni
is a simple NextBus API Client library and command line tool for retrieving
NextBus route and stop prediction information.
$ gem install muni
# Set NextBus agency (default 'sf-muni')
Muni::Base.set_agency('art')
# Find all routes.
Muni::Route.find(:all)
# => [<Muni::Route tag="F" title="F-Market & Wharves">, ...]
# Find a specific route
r21 = Muni::Route.find(21)
# => <Muni::Route directions=[<Muni::Direction id="21_IB1" name="Inbound to Steuart Terminal" ...
# Get a prediction
r21.outbound.stop_at("Hayes and Laguna").predictions
# => [<Muni::Prediction block="2108" delayed="true" dirTag="21_OB4" epochTime="1306877956823" isDeparture="false" minutes="3" seconds="198" ...
muni
includes a basic command-line interface, mostly as example usage of the client library. See bin/muni
.
Tasks:
muni help [TASK] # Describe available tasks or one specific task
muni list # Lists all routes
muni predict [ROUTE] [DIRECTION] [STOP] # Retrieve predictions for a route at a specific stop
muni show [ROUTE_TAG] [DIRECTION] # Shows a specifc route by name
- @jeffremer (maintainer)
- @gregorym
- @jameshwang
- bf4