Git Product home page Git Product logo

london-bike-hire-cli's Introduction

London Bike Hire CLI

A simple command line interface to London's Bike Hire API.

Gem Version

Description

This gem provides a command line interface to find information about London's Bike Hire stations, it allows you to find stations by name or their ID or a location and retrieve information about the status of a station.

I got fed up digging through the official map to see which bike stations were free - everyone knows the command line is way more efficient.

Boris

Here's the spec for London Bike Hire CLI:

Demo commands

Getting started

Using london-bike-hire-cli could not be simpler - just install the london-bike-hire-cli gem.

$ gem install london-bike-hire-cli

Usage

You can run london-bike-hire-cli from the command line with just the lbh command.

Command line help

For a list of arguments just use the -h switch.

$ lbh -h

List all bike stations

List all however-many-hundred bike stations there are. With pagination.

$ lbh all

Find the nearest bike station

Find a the nearest bike station to the specified type below. This will return five stations.

Available types:

  • search - Most search terms; such as placename, postcode
  • id - An ID of another bike station
$ lbh near --{type} {search_value}

# Near by search term
$ lbh near --search N19AE
$ lbh near --search 'waterloo station'

# Near another bike station id
$ lbh near --id 123

Note: Don't forget to wrap search term in quotes if it contains spaces.

Find a bike station by id

Find a Bike station by it's Tfl station ID. This will return one station.

$ lbh find --id {id}
$ lbh find --id 439

Find all bike stations by name

Search all bike stations' name attribute for the search value. This will return zero or more results.

$ lbh where --{attribute} {search_value}
$ lbh where --name kings

Results

$ lbh find --id 439
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
----- Bike station
Id: 439
Name: Killick Street, Kings Cross
Lat: 51.5338
Long: -0.118677
Temporary: false
Bikes: 13
Docks_free: 9
Docks_total: 22
Link to map: https://www.google.co.uk/maps/preview/@51.5338,-0.118677,17z
Updated at: 2015-03-31 20:46:01
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Contributing

  1. Fork it ( https://github.com/rob-murray/london-bike-hire-cli/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Development

Install dependancies

$ bundle install --no-deployment

Run test script as entry point to application

$ ruby test.rb find --id 439

License

This project is available for use under the MIT software license. See LICENSE

The above image is copyright 2015 Getty Images - Getty Images for Santander.

london-bike-hire-cli's People

Contributors

gitter-badger avatar rob-murray avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

london-bike-hire-cli's Issues

List all Stations

Should be able to list all stations with paginations so can browse list.

$ bbcli all

Find nearest Bike Stations

Locate the nearest N Bike Stations by * Postcode?

Something like this...

$ bbcli near --{type} {search_value}
$ bbcli near --postcode N19AE

Find nearest Bike Stations by ID

Add a new type to the near search to find the nearest N stations to an ID.

$ bbcli near --{type} {search_value}
$ bbcli near --id 123

A console type of command interface

Currently each command starts the application, fetches data, outputs and exits - add option to accept input in loop yielding same command interface but never exiting until told to do so.

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.