From e6d42a3488f21f5fd1e176e468076604360e50db Mon Sep 17 00:00:00 2001 From: B3none Date: Fri, 16 Feb 2018 16:46:37 +0000 Subject: [PATCH] Added example response and example use in the readme. --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b2db39..e0c51ca 100644 --- a/README.md +++ b/README.md @@ -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 (ablackham2000@gmail.com)