Giter Site home page Giter Site logo

transprt's Introduction

transprt

Gem Version Dependency Status Build Status

Ruby client for the Swiss public transport API at http://transport.opendata.ch

Installation

gem install transprt

#run example
ruby example.rb

Usage

To talk to the API, get a client:

require 'transprt'
client = Transprt::Client.new

See below how to use this client.

Hint: You may specify a mirror of the API other than http://transport.opendata.ch using the first argument of the constructor.

Locations

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

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

Connections

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

client.connections from: 'Lausanne', to: 'Geneva'

Station board

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

# Display station board
client.stationboard station: 'Lausanne'

Development

Running the tests

rake test

License

MIT License (MIT)

transprt's People

Contributors

severinraez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

puzzle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.