projects
/
www-offliberty.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
121ecfa
)
Make OFF_URL easier to override and add documentation
author
Marius Gavrilescu
<marius@ieval.ro>
Thu, 14 Jul 2016 07:16:24 +0000
(08:16 +0100)
committer
Marius Gavrilescu
<marius@ieval.ro>
Thu, 14 Jul 2016 07:16:24 +0000
(08:16 +0100)
lib/WWW/Offliberty.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/WWW/Offliberty.pm
b/lib/WWW/Offliberty.pm
index 01623629f69f49c9187ace2d33c85f0e98fdbfae..33740c83f6268acbbeedbf8044b7f4807dee22c6 100644
(file)
--- a/
lib/WWW/Offliberty.pm
+++ b/
lib/WWW/Offliberty.pm
@@
-7,7
+7,7
@@
use parent qw/Exporter/;
our $VERSION = '1.000002';
our @EXPORT_OK = qw/off/;
our $VERSION = '1.000002';
our @EXPORT_OK = qw/off/;
-
use constant OFF_URL =>
'http://offliberty.com/off03.php';
+
our $OFF_URL =
'http://offliberty.com/off03.php';
use HTML::TreeBuilder;
use HTTP::Tiny;
use HTML::TreeBuilder;
use HTTP::Tiny;
@@
-16,7
+16,7
@@
our $http = HTTP::Tiny->new(agent => "WWW-Offliberty/$VERSION ", default_headers
sub off{
my ($url, @params) = @_;
sub off{
my ($url, @params) = @_;
- my $ret = $http->post_form(OFF_URL, {track => $url, @params});
+ my $ret = $http->post_form(
$
OFF_URL, {track => $url, @params});
die $ret->{reason} unless $ret->{success}; ## no critic (RequireCarping)
my $root = HTML::TreeBuilder->new_from_content($ret->{content});
map { $_->attr('href') } $root->look_down(qw/_tag a class download/);
die $ret->{reason} unless $ret->{success}; ## no critic (RequireCarping)
my $root = HTML::TreeBuilder->new_from_content($ret->{content});
map { $_->attr('href') } $root->look_down(qw/_tag a class download/);
@@
-53,6
+53,14
@@
audio-only URL when called with no parameters, and two URLs
B<video_file> set to B<1>. In contrast, Vimeo URLs with no parameters
return both audio-only and audio/video variants.
B<video_file> set to B<1>. In contrast, Vimeo URLs with no parameters
return both audio-only and audio/video variants.
+Note: The URL of the service sometimes changes, which breaks this
+module. If you notice this, please report a bug on RT. While the bug
+is being fixed, you can override the URL locally by doing:
+
+ $WWW::Offliberty:OFF_URL = 'http://offliberty.com/correct_url.php';
+
+before calling off.
+
=head1 SEE ALSO
L<http://offliberty.com>
=head1 SEE ALSO
L<http://offliberty.com>
This page took
0.010696 seconds
and
4
git commands to generate.