Giter Club home page Giter Club logo

horaires-ratp-sdk's Introduction

Horaires RATP SDK

Retrieve real time schedules for any given RER (train), Metro, Tramway or Bus stop in real time.

You hate SOAP protocol and want to use the official RATP API? Welcome here.

BEWARE : WSDL contains some "frenglish" such as documentation.

Translations

This README file is also available in french.

Requirements

  • Access to the RATP API (see here)
  • PHP >= 5.6
  • Package php-soap (ext-soap extension)

Installation

composer require pgrimaud/horaires-ratp-sdk

Basic usage

Get all stations of a line.

use Ratp\Api;

$reseau = new \Ratp\Reseau();
$reseau->setCode('metro');

$line = new \Ratp\Line();
$line->setReseau($reseau);
$line->setCode('8');

$station = new \Ratp\Station();
$station->setLine($line);

$stations = new \Ratp\Stations($station);

$api = new Api();

$return = $api->getStations($stations)->getReturn();

foreach ($return->getStations() as $station) {
    /** @var \Ratp\Station $station */
    echo $station->getName() . "\n";
}

You can see more examples here.

TODO (but la flemme)

  • Unit tests

Copyrights

This project is not affiliated with or endorsed by the RATP.

Licence

Licensed under the terms of the MIT License.

horaires-ratp-sdk's People

Contributors

pgrimaud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

horaires-ratp-sdk's Issues

Method getPerturbations doesn't work

Message sent :

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://wsiv.ratp.fr">
    <SOAP-ENV:Body>
        <ns1:getPerturbations>
            <ns1:perturbation xsi:nil="true" />
            <ns1:isXmlText>false</ns1:isXmlText>
        </ns1:getPerturbations>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Message received :

<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <ns2:getPerturbationsResponse xmlns:ns2="http://wsiv.ratp.fr">
            <ns2:return>
                <ns1:argumentSource xmlns:ns1="http://wsiv.ratp.fr/xsd">babel</ns1:argumentSource>
            </ns2:return>
        </ns2:getPerturbationsResponse>
    </soapenv:Body>
</soapenv:Envelope>

WTF is 'babel' ?

Could not connect to host

L'erreur intervient au moment d'appeller une fonction avec Soap.

$api = new \Ratp\Api();
$version = $api->getVersion();

retour:

SoapFault: Could not connect to host

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.