Project

bort

0.0
No commit activity in last 3 years
No release in over 3 years
Bort makes BART API available in ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Comprehensive BART API ruby wrapper. Sorry for the lack of good documentation, but everything available at api.bart.gov is available in this gem. I've also created a few "shortcuts" below:

Installation

http://rubygems.org/gems/bort

gem install bort

Usage

Set up API key

require 'bort'
Bort::Bort('MW9S-E7SL-26DU-VV8V') # set your own API key here

Real-time data

trains = Bort.trains_near('mont', :color => 'blue', :direction => 'n')
=> ... # trains near Montgomery station going Northbound on the blue line

Schedule & planning trips

routes = Bort.routes
=> ... # all routes

Bort.route(1)
=> ... # info for route #1

Bort.trips('dubl', 'mont', :date => '6/10/2011', :time => '09:00+AM')
=> ... # trips from Dublin/Pleasanton to Montgomery on 6/10 around 9 AM

Bort.fare('dubl', 'mont')
=> 5.55

Bort.schedules
=> ... # all known schedules

Bort.schedule_at('mont')
=> ... # schedule at Montgomery for today

Station data

Bort.stations
=> ... # all 44 stations and partial info on them

Bort.station_info('mont')
=> ... # more info on Montgomery station

Inspired by

https://github.com/jish/bart