Update offliberty URL
[www-offliberty.git] / lib / WWW / Offliberty.pm
CommitLineData
de48830a
MG
1package WWW::Offliberty;
2
3use 5.014;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7our $VERSION = '0.001';
8our @EXPORT_OK = qw/off/;
9
10use HTML::TreeBuilder;
11use LWP::UserAgent;
12
13my $ua = LWP::UserAgent->new;
14
15sub off{
000e3496 16 my ($url, @params) = @_;
ab1cb0ce 17 my $content = $ua->post("http://offliberty.com/off54.php", {track => $url, @params})->decoded_content;
000e3496
MG
18 my $root = HTML::TreeBuilder->new_from_content($content);
19 map { $_->attr('href') } $root->look_down(qw/_tag a class download/);
de48830a
MG
20}
21
221;
23__END__
24
25=head1 NAME
26
27WWW::Offliberty - interface to offliberty.com download service
28
29=head1 SYNOPSIS
30
31 use WWW::Offliberty qw/off/;
32 my @links = off 'http://youtube.com/watch?v=something', video_file => 1;
33
34=head1 DESCRIPTION
35
36WWW::Offliberty is a simple interface to the offliberty.com download service.
37
38It exports a single function: B<off>(I<url>, [I<argument> => value...]).
39This function that returns a list of download links,
40as returned by the service.
41
42=head1 SEE ALSO
43
44L<http://offliberty.com>
45
46=head1 AUTHOR
47
48Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
49
50=head1 COPYRIGHT AND LICENSE
51
52Copyright (C) 2013 by Marius Gavrilescu
53
54This library is free software; you can redistribute it and/or modify
55it under the same terms as Perl itself, either Perl version 5.18.1 or,
56at your option, any later version of Perl 5 you may have available.
57
58
59=cut
This page took 0.012169 seconds and 4 git commands to generate.