Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeppos/skanetrafiken-php-api-client
Skånetrafiken API client for PHP.
https://github.com/jeppos/skanetrafiken-php-api-client
api-client api-wrapper php php71 skanetrafiken
Last synced: about 2 months ago
JSON representation
Skånetrafiken API client for PHP.
- Host: GitHub
- URL: https://github.com/jeppos/skanetrafiken-php-api-client
- Owner: jeppos
- Created: 2017-05-09T19:37:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T12:59:03.000Z (over 7 years ago)
- Last Synced: 2024-10-16T01:21:46.094Z (3 months ago)
- Topics: api-client, api-wrapper, php, php71, skanetrafiken
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
skanetrafiken-php-api-client
==
A simple Skånetrafiken PHP API client.[![Codacy Badge](https://api.codacy.com/project/badge/Grade/11f57782e049471ba15ed0622cb1b108)](https://www.codacy.com/app/jeppos/skanetrafiken-php-api-client?utm_source=github.com&utm_medium=referral&utm_content=jeppos/skanetrafiken-php-api-client&utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/jeppos/skanetrafiken-php-api-client.svg?branch=master)](https://travis-ci.org/jeppos/skanetrafiken-php-api-client)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/11f57782e049471ba15ed0622cb1b108)](https://www.codacy.com/app/jeppos/skanetrafiken-php-api-client?utm_source=github.com&utm_medium=referral&utm_content=jeppos/skanetrafiken-php-api-client&utm_campaign=Badge_Coverage)# Installation
## Composer```
composer require jeppos/skanetrafiken-php-api-client
```# Usage
Following example shows how to get upcoming departures from Malmö C.
```php
use Jeppos\SkanetrafikenApiClient\SerializerFactory;
use Jeppos\SkanetrafikenApiClient\Service\DepartureBoard;$guzzleClient = new \GuzzleHttp\Client([
'base_uri' => 'http://www.labs.skanetrafiken.se/v2.2/' // Version 2.2 of Skånetrafiken API
]);$departureBoard = new DepartureBoard($guzzleClient, SerializerFactory::create());
$departureBoard->setStopAreaId(80000); // 80000 = Malmö C
$departureBoard->call();$response = $departureBoard->getResponse();
```