robertfausk / kurzlink-api-client
api client for url shortener kurzelinks.de
Installs: 30
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:api-client
Requires
- php: >=7.2
- symfony/http-client: ~3.4|~4.0|~5.0
Requires (Dev)
- phpunit/phpunit: ~8.0
README
Very simple api client written in PHP for url shortener kurzelinks.de which supports ogy.de, t1p.de, 0cn.de, kurzelinks.de and also own domains.
Install
composer require --dev robertfausk/kurzlink-api-client
Usage Example
<?php use Robertfausk\KurzlinkApiClient\KurzlinkClient; $apiKey = 'your secret api key'; $kurzlinkAddress = 't1p.de'; $useSandbox = true; $client = KurzlinkClient::create($apiKey, $kurzlinkAddress, $useSandbox); $urlToShorten = 'https://google.de/'; $requestParams = [ // feel free to use every param from api doc 'requesturl' => '', ]; $shortUrl = $client->request($urlToShorten, $requestParams);
How to upgrade?
Have a look at CHANGELOG for detailed information.
How to contribute?
Copy phpunit.xml.dist and insert your api key to be able to run the integration tests.
Start docker-compose with php web driver
docker-compose up php7.2
Run phpunit tests
docker-compose exec php7.2 vendor/bin/phpunit
Credits
Created by Robert Freigang robertfausk.