lyrixx / ratp
此包已被弃用且不再维护。未建议替代包。
一个小型爬虫/SDK,用于实时获取巴黎交通信息
v1.0.0
2015-10-16 15:40 UTC
Requires
- fabpot/goutte: 1.0.*
Requires (Dev)
- guzzle/plugin-mock: ~3.4
This package is auto-updated.
Last update: 2020-02-11 18:04:04 UTC
README
此仓库包含一个小型库,用于消费RATP REST Web服务(huhu)
用法
$api = new Lyrixx\Ratp\Api(); $stop = array( array('line' => '138', 'stop' => 'General Leclerc-Victor Hugo', 'type' => $api::TYPE_BUS), ); $stops = $api->getStops($stop); $stops[0]->getName(); // 'General Leclerc-Victor Hugo' $stops[0]->getLine(); // '138' $stops[0]->getType(); // 'metro' $direction = $stops[0]->getDirection('Ermont-Eaubonne RER.'); foreach($direction->getSchedule() as $time) { echo $time; // '11 mn'; }