Just a simple google URL shortener API wrapper.
- Copy the module in your Modules directory
- Include it in your application's bootstrap: 'kohana-google-shorten' => MODPATH.'kohana-google-shorten'
- Optional step: get your API key, read here
- Checkout sample codes below:
** Shorten URLs **
$key = ''; // your API key, optional
$longUrl = 'http://www.mongeslani.com';
$shortUrl = shorten::shorten($longUrl, $key);
** Expand shortened URLs **
$key = ''; // your API key, optional
$shortUrl = 'http://goo.gl/N4mCb';
$longUrl = shorten::expand($shortUrl, $key);
** Get Analytics for the shortened URLs **
$key = ''; // your API key, optional
$shortUrl = 'http://goo.gl/N4mCb';
$longUrl = shorten::expand($shortUrl, $key, TRUE); // same as expanding but with additional parameter
Please report it to the issues tracker.