Transprt

Use the Swiss public transport API (open data)

transprt

Gem Version Dependency Status

Use the Swiss public transport API (open data). http://transport.opendata.ch

Installation

gem install transprt

#run example
ruby example.rb

Usage

Locations

http://transport.opendata.ch/#locations

require 'transprt'
Transprt.locations :query => 'Geneva'
# => [{"id"=>"008501008", "name"=>"Genève", "score"=>"101", "coordinate"=>{"type"=>"WGS84", "x"=>6.142455, "y"=>46.210199}, "distance"=>nil}]

Connexions

http://transport.opendata.ch/#connections

require 'transprt'
Transprt.connexions :from => 'Lausanne', :to => 'Geneva'

Station board

http://transport.opendata.ch/#stationboard

# Display station board
Transprt.stationboard :station => 'Lausanne'

Licence

MIT License (MIT)