This application finds sources of General Transit Feed Specification (GTFS) open transit data from community-maintained sites like the GTFS Data Exchange and the Google Transit Data Feed Wiki, periodically checks feed sources to confirm current data or download new data, and makes the data available for public consumption through an API and front-end interface.
Visit next-train.info in a web browser.
You may make HTTP requests or view GTFS data in a browser using the endpoint urls listed below.
- /agencies (lists all participating transit agencies)
- /agencies/
:agency_abbrev(lists all train stations serviced by a given agency) - /agencies/
:agency_abbrev/stations/:station_abbrev(lists upcoming departures from a given station)
These endpoints return HTML by default. To request a JSON response instead, suffix .json to the endpoint url.
You may schedule tasks to load all known GTFS data, or just the data you specify.
bundle exec rake station_attendant:find_data_exchange_feedsbundle exec rake station_attendant:find_google_transit_data_feedsbundle exec rake station_attendant:find_and_consume_and_loadYou may download GTFS data from specified source(s) into a filesystem or a database.
FeedConsumer.perform(:source_urls => ["http://www.shorelineeast.com/google_transit.zip", "http://web.mta.info/developers/data/mnr/google_transit.zip"])FeedConsumer.perform(:load => true, :source_urls => ["http://www.shorelineeast.com/google_transit.zip", "http://web.mta.info/developers/data/mnr/google_transit.zip"])To request a new feature, create an issue.
To deliver a new feature, fork the repo, make your changes, add tests if possible, and submit a pull request.
Install dependencies for a Ruby on Rails application.
- ruby (via rbenv)
- bundler
- rails
- mysql (or postgres, etc. according to database.yml)
Obtain source code.
git clone git@github.com:data-creative/branford_station.git
cd branford_stationInstall gem dependencies.
bundle installCreate database user.
-- mysql:
CREATE USER 'branford_station'@'localhost' IDENTIFIED BY 'branford_station';
GRANT ALL ON *.* to 'branford_station'@'localhost';Create database.
bundle exec rake db:create
bundle exec rake db:migratePopulate database.
bundle exec rake:db:seedStart web server.
rails serverView in browser at localhost:3000.
Reference "Deploying a Rails app to Heroku" and "Working with Databases on Heroku".
git push heroku masterView in browser at https://branford-station.herokuapp.com/.