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.
Here's the spec for London Bike Hire CLI:
Using london-bike-hire-cli could not be simpler - just install the london-bike-hire-cli gem.
$ gem install london-bike-hire-cli
You can run london-bike-hire-cli from the command line with just the lbh
command.
For a list of arguments just use the -h
switch.
$ lbh -h
List all however-many-hundred bike stations there are. With pagination.
$ lbh all
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, postcodeid
- 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 it's Tfl station ID. This will return one station.
$ lbh find --id {id}
$ lbh find --id 439
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
$ 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
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- Fork it ( https://github.com/rob-murray/london-bike-hire-cli/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Install dependancies
$ bundle install --no-deployment
Run test script as entry point to application
$ ruby test.rb find --id 439
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
london-bike-hire-cli's Issues
List all Stations
Should be able to list all stations with paginations so can browse list.
$ bbcli all
Simplify repository, querying, etc
Implement proper repository ala something like this http://hawkins.io/2013/10/implementing_the_repository_pattern/
- Simplify code
- Provide better querying capabilty
Add post-install message with "getting started" commands
Show a post install message with how to use the gem i.e. a few commands to get started.
Do I have to rename this project and gem now?
Improve output readability
With more than a couple of stations the output can be hard to read; maybe colour some rows /?
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.
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
Find nearest Bike Stations
Locate the nearest N Bike Stations by * Postcode?
Something like this...
$ bbcli near --{type} {search_value}
$ bbcli near --postcode N19AE
Add post install message with instructions
Generate a link to a map for each station
For each station displayed, a link to GoogleMaps should be generated so that I can see where they are.
e.g.
https://www.google.co.uk/maps/preview/@51.53005939,-0.120973687,17z
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.