robertfausk / kurzlink-api-client
api client for url shortener kurzelinks.de
Package info
github.com/robertfausk/kurzlink-api-client
Type:api-client
pkg:composer/robertfausk/kurzlink-api-client
v0.0.1
2020-12-09 09:12 UTC
Requires
- php: >=7.2
- symfony/http-client: ~3.4|~4.0|~5.0
Requires (Dev)
- phpunit/phpunit: ~8.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.