2017 © Pedro PelĂĄez
 

library emt-sdk-php

Unofficial PHP SDK for Madrid's EMT OpenData API

image

carlosafonso/emt-sdk-php

Unofficial PHP SDK for Madrid's EMT OpenData API

  • Saturday, May 12, 2018
  • by carlosafonso
  • Repository
  • 1 Watchers
  • 2 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

emt-sdk-php

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

An unofficial PHP SDK for Madrid's municipal bus company (EMT) OpenData API., (*2)

Install

Via Composer, (*3)

``` bash $ composer require carlosafonso/emt-sdk-php, (*4)


## Usage You'll need a set of authentication credentials issued by the EMT OpenData team. These credentials can be obtained here: http://opendata.emtmadrid.es/Formulario. Create an instance of the SDK client passing the credentials described above: ```php $clientId = 'FOO.BAR.BAZ'; $passkey = 'ABCDEFGH-1234-ABCD-1234-ABCDEFGHIJKL' $client = new Afonso\Emt\BusClient($clientId, $passkey);

Then call any of the available methods:, (*5)

$data = $client->getRouteLines([123], new \DateTime());
print_r($data);

Which should output something like this (truncated for readability):, (*6)

Array
(
    [0] => stdClass Object
        (
            [line] => 123
            [secDetail] => 10
            [orderDetail] => 1
            [node] => 1425
            [distance] => 0
            [distancePreviousStop] => 0
            [name] => PZA.DE LEGAZPI-MAESTRO ARBOS
            [latitude] => 40.390813555735
            [longitude] => -3.6951516754786
        )

    [1] => stdClass Object
        (
            [line] => 123
            [secDetail] => 10
            [orderDetail] => 1
            [node] => 930
            [distance] => 839
            [distancePreviousStop] => 839
            [name] => ANTONIO LOPEZ-AV.CORDOBA
            [latitude] => 40.386984182818
            [longitude] => -3.6982344337479
        )
)

Each web service has its own client implementation:, (*7)

$busClient = new Afonso\Emt\BusClient($clientId, $passkey);
$geoClient = new Afonso\Emt\GeoClient($clientId, $passkey);

/* (additional clients are on the works) */

Available methods

The current version of this library exposes all API endpoints from the BUS web service (http://opendata.emtmadrid.es/Servicios-web/BUS)., (*8)

Additional services are expected to be implemented soon., (*9)

Change log

Please see CHANGELOG for more information on what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*12)

Security

If you discover any security related issues, please email carlos.afonso.perez@gmail.com instead of using the issue tracker., (*13)

Credits

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

12/05 2018

dev-master

9999999-dev https://github.com/carlosafonso/emt-sdk-php

Unofficial PHP SDK for Madrid's EMT OpenData API

  Sources   Download

MIT

The Requires

 

The Development Requires

carlosafonso emt-sdk-php

04/01 2017

v0.1.0

0.1.0.0 https://github.com/carlosafonso/emt-sdk-php

Unofficial PHP SDK for Madrid's EMT OpenData API

  Sources   Download

MIT

The Requires

 

The Development Requires

carlosafonso emt-sdk-php