root/trunk/plagger/assets/plugins/Filter-FindEnclosures/yourfilehost.pl

Revision 899 (checked in by miyagawa, 2 years ago)

FindEnclosures?: Update find() method signature so that plugins can use URL of the page

Line 
1 sub handle {
2     my ($self, $url) = @_;
3     $url =~ qr!http://www\.yourfilehost\.com/media\.php\?!;
4 }
5
6 sub find {
7     my ($self, $args) = @_;
8
9     if ($args->{content} =~ m!<a href="([^\"]*)">DOWNLOAD\s*THIS FILE</a>!s) {
10         my $enclosure = Plagger::Enclosure->new;
11         $enclosure->url($1);
12         $enclosure->auto_set_type;
13         return $enclosure;
14     }
15
16     return;
17 }
Note: See TracBrowser for help on using the browser.