2017 © Pedro Peláez
 

library googl

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

image

dotzero/googl

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

  • Wednesday, October 11, 2017
  • by dotzero
  • Repository
  • 2 Watchers
  • 8 Stars
  • 8,787 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 2 Versions
  • 22 % Grown

The README.md

PHP Googl

Build Status Latest Stable Version License, (*1)

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

Usage

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

Shorten URL

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

try {
    $googl = new \dotzero\Googl('YOUR_GOOGLE_API');
    echo $googl->shorten('http://github.com');
} catch (\dotzero\GooglException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}

Expand URL

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

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

Install

Via composer:

$ composer require dotzero/googl

Without composer

Clone the project using git clone https://github.com/dotzero/googl-php/ and include the source file with require_once("googl-php/src/Googl.php");, (*6)

Test

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

GOOGLE_API=YOUR_GOOGLE_API vendor/bin/phpunit

License

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

The Versions

11/10 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar dotzero

api googl shortener

11/04 2016

0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar dotzero

api googl shortener