2017 © Pedro Peláez
 

library urlshortnerapi

URL Shortner API

image

leela/urlshortnerapi

URL Shortner API

  • Thursday, September 10, 2015
  • by leelanarasimha
  • Repository
  • 1 Watchers
  • 0 Stars
  • 412 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 33 % Grown

The README.md

UrlShortnerApi

URL Shortner API shortens the url with Google short service and also TinyUrl shortening service., (*1)

It takes the long url and converts it into the short url., (*2)

Uses Strategy Design Pattern, (*3)

It also takes the short url and sends the statistics and also the long url., (*4)

Begin by installing this package through Composer. Edit your project's composer.json file to require`., (*5)

"require": {
"leela/urlshortnerapi": "1.1"
}

Next, update Composer from the Terminal:, (*6)

composer update

That's it! You're all set to go., (*7)

Usage for tiny url Shorten

<?php

$tinyUrlInstance = new \Leela\services\TinyUrlShortner(TINYURL_API_KEY);
$urlshortner = new Leela\UrlShortner($tinyUrlInstance);
try {
    echo $urlshortner->getLongUrl($shortUrl, $total_options);
    echo $urlshortner->getShortUrl($longUrl);
} catch (Exception $e) {
    echo $e->getMessage();
}

Usage for Google url Shorten

<?php

$googleUrlInstance = new \Leela\services\GoogleUrlShortner(Google_API_KEY);
$urlshortner = new Leela\UrlShortner($googleUrlInstance);
try {
    echo $urlshortner->getLongUrl($shortUrl, $total_options);
    echo $urlshortner->getShortUrl($longUrl);
} catch (Exception $e) {
    echo $e->getMessage();
}

Methods

getLongUrl($shortUrl, $total_options);

$shortUrl = Google Shorten Url or tiny shorten url

$total_options = TRUE or FALSE;
TRUE returns all the history list of the url
FALSE returns only the public url;


getShortUrl($longUrl)
$longUrl - The actual url need to be shorten;

Contributor

Leela Narasimha Reddy - leela@leelag.com, (*8)

Issues & Suggestions

Please report any bugs or feature requests here: https://github.com/leelanarasimha/UrlShortnerApi/issues, (*9)

The Versions

10/09 2015

dev-master

9999999-dev

URL Shortner API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by leela narasimha

10/09 2015

dev-bitlysupport_v1

dev-bitlysupport_v1

URL Shortner API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by leela narasimha

10/09 2015

v1.4

1.4.0.0

URL Shortner API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by leela narasimha

02/04 2015

v1.1

1.1.0.0

URL Shortner API

  Sources   Download

MIT

by leela narasimha

01/04 2015

v1.0

1.0.0.0

URL Shortner API

  Sources   Download

by leela narasimha