Download the PHP package jessicadigital/tflcycles without Composer
On this page you can find all versions of the php package jessicadigital/tflcycles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jessicadigital/tflcycles
More information about jessicadigital/tflcycles
Files in jessicadigital/tflcycles
Package tflcycles
Short Description A module to fetch Santander Cycle availability within a distance of specified locations.
License
Informations about the package tflcycles
jessicadigital/tflcycles
A module to fetch Santander Cycle hire locations within a distance of specified locations. Read more on the blog.
Installation
To include this package in your project, use composer:
Fetching hire locations
To fetch locations, first create a new instance of the TflCycles class:
Now, specify your location(s) to find nearby hire stations:
You must specify one or more locations.
Next, set the search distance (in metres), e.g.
for 2km. This will find all bike hire locations within 2km of any of the specified locations. The default is 1000m.
Now, perform a search. Use the method to return an array of stations, or to save this array directly to a file.
Example
This example will fetch all cycle hire stations within 500m of Euston and Waterloo rail stations and save to a file called :
Usage
This package uses the TfL Santander Cycle API. Please abide by their Terms and Conditions.
Do not make repeated requests to the API - the data is only updated every five minutes. The recommended approach for using this package is to set up a scheduled CRON job to fetch and cache the data you need.
This project has no connection with TfL or the bike hire scheme; it was created as part of a development project and released for the community to enjoy.