h2akim / googl
Google URL Shortener API
Installs: 20 519
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 0
This package is not auto-updated.
Last update: 2024-11-08 19:23:09 UTC
README
Simple PHP library for Google URL Shortener API
Discontinuation
As Google's URL Shortener service will be discontinued on March 30, 2019, there is no new development of this package from now on. Thanks
Getting Started
Composer
composer require h2akim/googl:*
How to Use
Create a new shorten URL
Parameters available:
- longUrl
- object (optional) - return as object (if true)
namespace H2akim\Googl; $googl = new Googl('your-api-key'); $googl->create([ 'longUrl' => 'http://url.that.you.want.com' ]);
Retrieve original url from shorten URL
Parameters available:
- shortUrl
- projection - ANALYTICS_CLICKS / ANALYTICS_TOP_STRINGS / FULL
- object (optional) - return as object (if true)
namespace H2akim\Googl; $googl = new Googl('your-api-key'); $googl->expand([ 'shortUrl' => 'http://goo.gl/short-url' ]);