
I have combined the 2 previous posts for expanding and shortening goo.gl URLs and have created a small class for it. Below is the download link for the class.
Expanding a URL
expand('
http://goo.gl/WlFX');if(FALSE === $result)
{
echo $objAPI->error;
}
else
{
echo 'Long URL:'.$result;
}
?>
Shorten A URL
shorten('
https://www.packtpub.com/php-jquery-c...if(FALSE === $result)
{
echo $objAPI->error;
}
else
{
echo 'Short URL:'.$result;
}
?>
As I have mentioned e...
Published on January 20, 2011 11:55