WWW::Shorten::Googl - Perl interface to http://goo.gl/
use strict; use warnings; use WWW::Shorten::Googl; # OR # use WWW::Shorten 'Googl'; # $ENV{GOOGLE_API_KEY} should be set my $url = 'http://metacpan.org/pod/WWW::Shorten::Googl'; my $short_url = makeashorterlink($url); my $long_url = makealongerlink($short_url); # Note - this function is specific to the Googl shortener my $stats = getlinkstats( $short_url );
A Perl interface to the http://goo.gl/ URL shortening service. Googl simply maintains a database of long URLs, each of which has a unique identifier.
The function makeashorterlink will call the Googl web site passing it your long URL and will return the shorter Googl version.
makeashorterlink
If you provide your Google username and password, the link will be added to your list of shortened URLs at http://goo.gl/.
See AUTHENTICATION for details.
The function makealongerlink does the reverse. makealongerlink will accept as an argument either the full URL or just the identifier.
makealongerlink
Given a http://goo.gl/ URL, returns a hash ref with statistics about the URL.
See http://code.google.com/apis/urlshortener/v1/reference.html#resource_url for information on which data can be present in this hash ref.
To use this shorten service, you'll first need to setup an API Key.
Once you have that key setup, you will need to set the GOOGLE_API_KEY environment variable to use that key.
GOOGLE_API_KEY
Magnus Erixzon <magnus@erixzon.com>
Chase Whitener <capoeirab@cpan.org>
Copyright 2004, Magnus Erixzon <magnus@erixzon.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
WWW::Shorten, http://goo.gl/, API Reference
To install WWW::Shorten::Googl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Shorten::Googl
CPAN shell
perl -MCPAN -e shell install WWW::Shorten::Googl
For more information on module installation, please visit the detailed CPAN module installation guide.