ianlchapman/tube-status

This package is abandoned and no longer maintained. No replacement package was suggested.

Status information for London Underground lines.

0.1 2018-09-30 20:17 UTC

This package is auto-updated.

Last update: 2021-09-29 02:23:46 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

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

  1. 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/.

  2. 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.