A ruby wrapper around the BART API.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 23 commits behind jish:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.md
Rakefile
bart.gemspec

README.md

A ruby wrapper around the BART API. http://api.bart.gov/

Usage

Create a new station object

require 'bart/station'

station = Bart::Station.new('ssan')
station.name
# => "South San Francisco"

And see when then next trains are supposed to arrive

station.load_departures
station.departures.map do |d|
  [d.destination.name, d.estimates.map { |e| e.minutes }]
end
# => [["Pittsburg/Bay Point", [5, 25, 50]], ["Millbrae", [5, 25, 46]]]

Output a list of upcoming departures:

require 'bart'
puts Bart(:powl).departures
# San Francisco Int'l Airport 2, 22
# Pittsburg/Bay Point 4, 19

NOTE: This is still beta software. All public APIs are subject to change