-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example response and example use in the readme.
- Loading branch information
B3none
committed
Feb 16, 2018
1 parent
887b5af
commit e6d42a3
Showing
1 changed file
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,55 @@ | ||
# emtapi | ||
East Midlands Trains API Interface written in PHP. | ||
# emtapi-client | ||
East Midlands Trains API Client written in PHP. | ||
|
||
# Composer | ||
```$xslt | ||
composer require b3none/emtapi-client | ||
``` | ||
|
||
# Example use | ||
```php | ||
$emtapi = new \B3none\emtapi\EMTClient(); | ||
$emtapi->getJourneys('Derby', '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' | ||
] | ||
] | ||
] | ||
] | ||
] | ||
|
||
``` | ||
|
||
# Credits | ||
* Alex Blackham ([email protected]) |