WWW::Google::URLShortener - Interface to Google URL Shortener API.
Version 0.05
The Google URL Shortener at goo.gl is a service that takes long URLs and squeezes them into fewer characters to make a link that is easier to share, tweet, or email to friends. Currently it supports version v1.
IMPORTANT: The version v1 of the Google URL Shortener API is in Labs, and its features might change unexpectedly until it graduates.
The constructor expects your application API, which you can get it for FREE from Google.
use strict; use warnings; use WWW::Google::URLShortener; my $api_key = 'Your_API_Key'; my $google = WWW::Google::URLShortener->new($api_key);
Returns the shorten url for the given long url as provided by Google URL Shortener API. This method expects one scalar parameter i.e. the long url.
use strict; use warnings; use WWW::Google::URLShortener; my $api_key = 'Your_API_Key'; my $google = WWW::Google::URLShortener->new($api_key); print $google->shorten_url('http://www.google.com');
Returns the expaned url for the given long url as provided by Google URL Shortener API. This method expects one scalar parameter i.e. the short url.
use strict; use warnings; use WWW::Google::URLShortener; my $api_key = 'Your_API_Key'; my $google = WWW::Google::URLShortener->new($api_key); print $google->expand_url('http://goo.gl/fbsS');
Returns the analytics for the given short url as provided by Google URL Shortener API in the XML format. This method expects one scalar parameter i.e. the short url.
use strict; use warnings; use WWW::Google::URLShortener; my $api_key = 'Your_API_Key'; my $google = WWW::Google::URLShortener->new($api_key); print $google->get_analytics('http://goo.gl/fbsS');
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to bug-www-google-urlshortener at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Google-URLShortener. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-google-urlshortener at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::Google::URLShortener
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Google-URLShortener
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-Google-URLShortener
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Google-URLShortener
Search CPAN
http://search.cpan.org/dist/WWW-Google-URLShortener/
Copyright 2011 Mohammad S Anwar.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install WWW::Google::URLShortener, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Google::URLShortener
CPAN shell
perl -MCPAN -e shell install WWW::Google::URLShortener
For more information on module installation, please visit the detailed CPAN module installation guide.