Changeset 899

Show
Ignore:
Timestamp:
06/02/06 20:09:15
Author:
miyagawa
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/assets/plugins/Filter-FindEnclosures/yourfilehost.pl

    r894 r899  
    55 
    66sub find { 
    7     my ($self, $content) = @_; 
     7    my ($self, $args) = @_; 
    88 
    9     if ($content =~ m!<a href="([^\"]*)">DOWNLOAD\s*THIS FILE</a>!s) {  
     9    if ($args->{content} =~ m!<a href="([^\"]*)">DOWNLOAD\s*THIS FILE</a>!s) {  
    1010        my $enclosure = Plagger::Enclosure->new; 
    1111        $enclosure->url($1); 
  • trunk/plagger/assets/plugins/Filter-FindEnclosures/youtube.pl

    r843 r899  
    77 
    88sub find { 
    9     my ($self, $content) = @_; 
     9    my ($self, $args) = @_; 
    1010 
    11     if ($content =~ /video_id=([^&]+)&l=\d+&t=([^&]+)/gms){ 
     11    if ($args->{content} =~ /video_id=([^&]+)&l=\d+&t=([^&]+)/gms){ 
    1212        my $enclosure = Plagger::Enclosure->new; 
    1313        $enclosure->url("http://youtube.com/get_video?video_id=$1&t=$2"); 
  • trunk/plagger/lib/Plagger/Plugin/Filter/FindEnclosures.pm

    r872 r899  
    150150            $content ||= $self->fetch_content($url) or return; 
    151151 
    152             if (my $enclosure = $plugin->find($content)) { 
     152            if (my $enclosure = $plugin->find({ content => $content, url => $url })) { 
    153153                Plagger->context->log(info => "Found enclosure " . $enclosure->url ." with " . $plugin->site_name); 
    154154                $entry->add_enclosure($enclosure);