Tatsuhiko Miyagawa > WWW-Shorten-RevCanonical-0.03 > WWW::Shorten::RevCanonical

Download:
WWW-Shorten-RevCanonical-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

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/

syntax highlighting: