CodeIgniter Forums
Goo.gl helper - A goo.gl shortener - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Goo.gl helper - A goo.gl shortener (/showthread.php?tid=29441)



Goo.gl helper - A goo.gl shortener - El Forum - 04-09-2010

[eluser]Isern Palaus[/eluser]
Goo.gl helper

I'm planning to release a e-Commerce system I coded in CodeIgniter in open-source so I've to familiarize with the public tools like Git/Bitbucket. I decided to create a profile and try with a simplest repository and here it's: codeigniter-googl-helper (with the name convention proposed by jamierumbelow).



You can grab the latest version in codeigniter-googl-helper at bitbucket or with a direct link to a zip file.

The usage is very simple: you need to load the helper and run the function googl_url().

Code:
$this->load->helper('googl');

$url = 'http://blog.ipalaus.es';

$short_url = googl_url($url);


You can optionally pass a second boolean (TRUE/FALSE) parameter to return the original URL if something goes wrong. Default is TRUE (will return the long url):

Code:
$short_url = googl_url($url, FALSE);



This is based in ggl-shortner by Matthew Flaschen.