Yii 1.1: google-url-shortener

goo.gl URL shortener
6 followers

This extension allows you to short url through google url shortener service goo.gl.

Requirements

Testing on Yii 1.1.8, but almost sure that it working in lower versions.

You must get an api key for goo.gl. Documentation for Google URL Shortener API.

Usage

Extract file to protected/extensions/shorturl/ Activate component in configuration file:

'components' => array(
// ...
'shorturl' => array(
    'class' => 'ext.shorturl.ShortUrl',
    'apiKey' => 'xxxxxx', // apikey
),
// ...
}

And now usage it in your application:

Yii::app()->shorturl->short('http://mysite.com/MyReallyLongUrl?withLongLongParams=1');

Resources

Total 2 comments

#4995 report it
dckurushin at 2011/09/04 06:03pm
Sorry, this is my local server problem... it works fine

dckurushin, could you dump variable $result?

Im sorry but I think this is my local server problem... on my other server it works...

#4994 report it
Stamm at 2011/09/04 05:47pm
Re: Not working for me...

dckurushin, could you dump variable $result?

Leave a comment

Please to leave your comment.

Create extension