2017 © Pedro Peláez
 

library google-shortly-php

A PHP library to generate shortened URL through The Google Shortener API

image

zhilevan/google-shortly-php

A PHP library to generate shortened URL through The Google Shortener API

  • Monday, March 13, 2017
  • by zhilevan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Php Google Shortner Url

A PHP5 library to generate shortened URL through The Google URL Shortener API., (*1)

Usage

Using an Google API key is highly recommended. To acquire an API key follow the instructions., (*2)

Shorten URL

Shorten a long URL using The Google URL Shortener API, (*3)

try {
    $googShort = new \yuseferi\GoogShortly('YOUR_GOOGLE_API');
    echo $googShort->shorten('http://yuseferi.com');
} catch (\yuseferi\GoogShortlyException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}

Expand URL

Expand a short URL using The Google URL Shortener API, (*4)

try {
    $googShort = new \yuseferi\GoogShortly('YOUR_GOOGLE_API');
    echo $googShort->expand('http://goo.gl/KkZ8');
} catch (\yuseferi\GoogShortlyException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}

Install

Via composer:

$ composer require yuseferi/google-shortly-php

Without composer

Clone the project using git clone https://github.com/yuseferi/google-shortly-php/ and include the source file with require_once("google-shortly-php/src/GoogShortly.php");, (*5)

Test

First install the dependencies, and after you can run:, (*6)

GOOGLE_API=YOUR_GOOGLE_API vendor/bin/phpunit

License

Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php, (*7)

The Versions

13/03 2017

dev-master

9999999-dev

A PHP library to generate shortened URL through The Google Shortener API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar zhilevan

short-url php-shortener google-short-url-php shortener-php

13/03 2017

0.1.2

0.1.2.0

A PHP library to generate shortened URL through The Google Shortener API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar zhilevan

short-url php-shortener google-short-url-php shortener-php

13/03 2017

0.1.1

0.1.1.0

A PHP library to generate shortened URL through The Google Shortener API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar zhilevan

short-url php-shortener google short url php shortener php

13/03 2017

0.1.0

0.1.0.0

A PHP5 library to generate shortened URL through The Google Shortener API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar zhilevan

api google shortener short-url