PHP: Expanding URLs using Google URL shortener API






Yesterday. google launched an API for its URL shortening service http://goo.gl. Using this API developers will be able to expand/shorten URLs and get a user's analytics and history programmaticaly.

Below is a small snippet of PHP code that expands a short URL. The response comes in JSON format, so we will use the json_decode function to convert it to object.

$shortUrl = 'http://goo.gl/WlFX';$response ...
 •  0 comments  •  flag
Share on Twitter
Published on January 11, 2011 00:22
No comments have been added yet.