robertfausk/kurzlink-api-client

api client for url shortener kurzelinks.de

v0.0.1 2020-12-09 09:12 UTC

This package is auto-updated.

Last update: 2024-04-09 18:26:19 UTC


README

Latest Stable Version Latest Unstable Version Total Downloads Build Status Scrutinizer Quality Score Code Coverage Software License PHP7 Compatible Open Issues Closed Issues Contributors Contributors

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.