oleander / googl
Google URL Shortener API in PHP
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/oleander/googl
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: 3.*
This package is not auto-updated.
Last update: 2025-12-30 13:24:55 UTC
README
Google URL shortener API in PHP
Usage
Shorten url
$client = new Googl\Base("username@gmail.com", "password"); $url = $client->shorten("http://www.bbc.co.uk/"); echo $url->short; # => "http://goo.gl/wZts"
Your url should now be visible at http://goo.gl/.
Expand url
$long = Googl\Base::expand("http://goo.gl/wZts"); echo $url->original; # => "http://www.bbc.co.uk/"
Install
Without Composer
Clone the project using git clone https://github.com/oleander/googl-php
and include the source file with require_once("googl-php/src/Googl.class.php");
With Composer
Add the following json to your composer.json file and run composer update.
{
"require" : {
"oleander/googl" : "dev-master"
}
}
Test
Tests can be found in the tests folder and executed by running
USER="username@gmail.com" PASSWORD="gmail-password" phpunit. Don't
forget to run composer update before you run the test suite.
Contributing
- Fork it ( http://github.com/oleander/googl-php/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request