ianlchapman / tube-status
Status information for London Underground lines.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.2
- guzzlehttp/guzzle: ~6.0
- nesbot/carbon: ^2.2
Requires (Dev)
This package is auto-updated.
Last update: 2021-09-29 02:23:46 UTC
README
A library that integrates with the TFL Tube Status API to show the status of London Underground lines using PHP.
Features
- Pulls tube lines from the TFL API
- Shows the current status of the lines as exposed by the TFL API
- Suite of unit tests
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist ianlchapman/tube-status "*"
or add
"ianlchapman/tube-status": "*"
to the require section of your composer.json
file.
Usage
-
First you need to get an Application ID and Application Key from the TFL API. Details are available on the API's website https://api.tfl.gov.uk/.
-
Pull the status of all the London Underground (tube) lines.
use IanLChapman\TubeStatus\TubeStatus; $statusService = new TubeStatus; $statusService->setApplicationId('APPLICATION_ID'); // replace these values with information from the TFL API $statusService->setApplicationKey('APPLICATION_KEY'); $statusService->getTubeStatus($client);
The call returns an array of tube lines including some basic information as well as their status.