WWW::HugeURL - Because bigger is better, right?


WWW-HugeURL documentation Contained in the WWW-HugeURL distribution.

Index


Code Index:

NAME

Top

WWW::HugeURL - Because bigger is better, right?

COPYRIGHT

Top


WWW-HugeURL documentation Contained in the WWW-HugeURL distribution.
package WWW::HugeURL;

use strict;
use warnings;
use WWW::Mechanize;
our $VERSION = '0.01';

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(makehugelink);

sub makehugelink {
    my $short = shift;
    my $mech = WWW::Mechanize->new;
    $mech->get('http://hugeurl.com');
    $mech->submit_form(
	form_number => 1,
	fields      => {
	    encode_url => $short,
	}
       );
    my $content = $mech->content();
    $content =~ m{<A HREF='(http://hugeurl.com/\?.+)'>};
    return $1;
}

1;