Skip to content

MiniCodeMonkey/Capital-Bikeshare-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capital Bikeshare API

Scrapes your member information from http://capitalbikeshare.com and outputs it nicely formatted as JSON

Usage

A local environment to interact with the data can be set up straight away if you're running PHP 5.4+

Install composer dependencies

$ composer install

Read more about Composer here

Start local webserver

$ php -S localhost:8080 -t public/

Perform API request

$ curl --user bikeshareusername http://localhost:8080/rentals

You will be prompted to enter you Bikeshare Password

Note: Depending on your rental history size, this may take a little while (It takes 2 1/2 minute to scrape my 300+ rentals).

If you're running this on a regular webserver, make sure that the data folder is writable by the webserver user. E.g. chmod -R 777 data/

Example output

[
  {
    "start_station": "14th & Rhode Island Ave NW",
    "start_date": "01-05-2013 12:56 pm",
    "end_station": "25th St & Pennsylvania Ave NW",
    "end_date": "01-05-2013 1:05 pm",
    "duration_seconds": 524,
    "duration": "8 minutes, 44 seconds",
    "cost": 0
  }
]

Features

  • Rental history
  • Caches results for 14 days using simple file-based cache

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages