use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'WWW::Offliberty',
- VERSION_FROM => 'lib/WWW/Offliberty.pm',
- ABSTRACT_FROM => 'lib/WWW/Offliberty.pm',
- AUTHOR => 'Marius Gavrilescu <marius@ieval.ro>',
- MIN_PERL_VERSION => '5.14.0',
- LICENSE => 'perl',
- SIGN => 1,
- PREREQ_PM => {
- HTML::TreeBuilder => 0,
- LWP::UserAgent => 0,
- },
- META_ADD => {
- dynamic_config => 0,
- resources => {
- repository => 'http://git.ieval.ro/?p=www-offliberty.git',
+ NAME => 'WWW::Offliberty',
+ VERSION_FROM => 'lib/WWW/Offliberty.pm',
+ ABSTRACT_FROM => 'lib/WWW/Offliberty.pm',
+ AUTHOR => 'Marius Gavrilescu <marius@ieval.ro>',
+ MIN_PERL_VERSION => '5.14.0',
+ LICENSE => 'perl',
+ SIGN => 1,
+ PREREQ_PM => {
+ HTML::TreeBuilder => 0,
+ LWP::UserAgent => 0,
},
- }
+ META_ADD => {
+ dynamic_config => 0,
+ resources => {
+ repository => 'http://git.ieval.ro/?p=www-offliberty.git',
+ },
+ }
);
my $ua = LWP::UserAgent->new;
sub off{
- my ($url, @params) = @_;
- my $content = $ua->post("http://offliberty.com/off.php", {track => $url, @params})->decoded_content;
- my $root = HTML::TreeBuilder->new_from_content($content);
- map { $_->attr('href') } $root->look_down(qw/_tag a class download/);
+ my ($url, @params) = @_;
+ my $content = $ua->post("http://offliberty.com/off.php", {track => $url, @params})->decoded_content;
+ my $root = HTML::TreeBuilder->new_from_content($content);
+ map { $_->attr('href') } $root->look_down(qw/_tag a class download/);
}
1;
use WWW::Offliberty qw/off/;
if ($ENV{NETWORK_TEST}) {
- plan tests => 2;
+ plan tests => 2;
- my @results;
+ my @results;
- @results = off "http://youtube.com/watch?v=Tj75Arhq5ho";
- is @results, 1, 'youtube';
+ @results = off "http://youtube.com/watch?v=Tj75Arhq5ho";
+ is @results, 1, 'youtube';
- @results = off "http://youtube.com/watch?v=Tj75Arhq5ho", video_file => 1;
- is @results, 2, 'youtube, video_file => 1';
+ @results = off "http://youtube.com/watch?v=Tj75Arhq5ho", video_file => 1;
+ is @results, 2, 'youtube, video_file => 1';
} else {
- plan skip_all => '$ENV{NETWORK_TEST} not true';
+ plan skip_all => '$ENV{NETWORK_TEST} not true';
}