NAME

WWW::Shorten::Shorl - Build Status

SYNOPSIS

use strict;
use warnings;

use WWW::Shorten 'Shorl'; # recommended
# use WWW::Shorten::Shorl; # also available

my $long_url = 'http://www.foo.com/bar/';
my $short_url = makeashorterlink($long_url);
my ($short_url,$password) = makeashorterlink($long_url);

$long_url = makealongerlink($short_url);

DESCRIPTION

WARNING: http://shorl.com does not provide an API. We must scrape the resulting HTML.

A Perl interface to the web site http://shorl.com. That service simply maintains a database of long URLs, each of which has a unique identifier.

Functions

WWW::Shorten::Shorl makes the following functions available.

my $short = try { makeashorterlink('http://www.example.com') } catch { warn $_ };

The function makeashorterlink will call use the web service, passing it your long URL and will return the shorter version. If used in a list context, then it will return both the shorter URL and the password.

Note that this service, unlike others, returns a unique code for every submission.

my $long = try { makealongerlink('abc11234234adfagv') } catch { warn $_ };

The function makealongerlink does the reverse. makealongerlink will accept as an argument either the full short URL or just the service's identifier.

If anything goes wrong, then either function will return undef.

AUTHOR

Iain Truskett spoon@cpan.org

CONTRIBUTORS

COPYRIGHT AND LICENSE

See the main WWW::Shorten docs.