/kohana-google-shorten

Google Shortener API Wrapper for KohanaPHP

Primary LanguagePHP

KO3 Google URL Shortener API Wrapper

Just a simple google URL shortener API wrapper.

To Use

  1. Copy the module in your Modules directory
  2. Include it in your application's bootstrap: 'kohana-google-shorten' => MODPATH.'kohana-google-shorten'
  3. Optional step: get your API key, read here
  4. Checkout sample codes below:

Sample Code

** 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

Issues

Please report it to the issues tracker.