Skip to content

Commit

Permalink
Added example response and example use in the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Feb 16, 2018
1 parent 887b5af commit e6d42a3
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions README.md
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])

0 comments on commit e6d42a3

Please sign in to comment.