Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b3none/emtapi-client
East Midlands Trains PHP API Client
https://github.com/b3none/emtapi-client
api client php trains-information
Last synced: about 2 months ago
JSON representation
East Midlands Trains PHP API Client
- Host: GitHub
- URL: https://github.com/b3none/emtapi-client
- Owner: B3none
- License: gpl-3.0
- Created: 2018-02-15T16:10:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-04T14:03:59.000Z (over 5 years ago)
- Last Synced: 2024-05-29T22:47:46.726Z (7 months ago)
- Topics: api, client, php, trains-information
- Language: PHP
- Homepage: https://b3none.github.io/emtapi-client/
- Size: 77.1 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# emtapi-client
East Midlands Trains API Client written in PHP.# Author
[B3none](https://b3none.co.uk/) - Developer / Maintainer# Composer
```$xslt
composer require b3none/emtapi
```# Example use
```php
$emtapi = \B3none\emtapi\EMTClient::create();
$emtapi->createStationsFile();
$emtapi->getJourneys(\B3none\emtapi\Station::DERBY, \B3none\emtapi\Station::NOTTINGHAM);
```# Example response
```php
[
'trains' => [
0 => [
'locationname' => 'Nottingham',
'st' => '16:40',
'et' => 'On time',
'cssclass' => null,
'operator' => 'CrossCountry',
'trainid' => '+eRxw6w7A8UJsGRGIAT5Ag==',
'platform' => '6A',
'selecteddets_sta' => '16:34',
'selecteddets_location' => 'Derby',
'selecteddets_length' => '23 minutes',
'selecteddets_prevlength' => '2 hours, 55 minutes',
'callingpoints' => [
'0' => [
'locationname' => 'Long Eaton',
'st' => '16:34',
'et' => 'On time',
'cssclass' => null
]
],
'previouscallingpoints' => [
0 => [
'locationname' => 'Cardiff Central',
'st' => '13:45',
'et' => null,
'cssclass' => 'circle-full',
'at' => 'On time'
]
]
]
]
]```
# Testing
To run all of the unit tests run
```bash
vendor/bin/phpunit tests
```