NAME
WWW::Shorten::RevCanonical - Shorten URL using rev="canonical"
SYNOPSIS
use WWW::Shorten 'RevCanonical';
my $short_url = makeashorterlink($long_url); # Note that this could fail and return undef
# Or, use WWW::Shorten::Simple wrapper
use WWW::Shorten::Simple;
my @shorteners = (
WWW::Shorten::Simple->new('RevCanonical'), # Try this first
WWW::Shorten::Simple->new('TinyURL'), # Then fallback to TinyURL
);
my $short_url;
for my $shortener (@shorteners) {
$short_url = $shortener->shorten($long_url)
and last;
}
DESCRIPTION
WWW::Shorten::RevCanonical is a WWW::Shorten plugin to extract rev="canonical" link from HTML web pages. Unlike other URL shortening services, the ability to make a short URL from rev="canonical" depends on whether the target site implements the tag, so the call to makeashorterlink
could fail, and in that case you'll get undef result. You might want to fallback to other shorten services like TinyURL.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
WWW::Shorten, WWW::Shoten::Simple, http://revcanonical.wordpress.com/