Changeset 472

Show
Ignore:
Timestamp:
04/02/06 00:57:26
Author:
miyagawa
Message:
  • EntryFullText?: Add handle_force() to handle based on URI.
  • Added livedoorblog.pl to fetch body from livedoor Blog
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r464 r472  
    66use Encode; 
    77use File::Spec; 
     8use List::Util qw(first); 
     9 
    810use Plagger::UserAgent; 
    911 
     
    6668    my($self, $context, $args) = @_; 
    6769 
    68     if ( $args->{entry}->body && $args->{entry}->body =~ /<\w+>/ ) { 
     70    my $handler = first { $_->handle_force($args) } @{ $self->{plugins} }; 
     71    if ( !$handler && $args->{entry}->body && $args->{entry}->body =~ /<\w+>/ ) { 
    6972        $self->log(debug => $args->{entry}->link . " already contains body. Skipped"); 
    7073        return; 
     
    7679    $args->{content} = $self->decode_content($res); 
    7780 
    78     for my $plugin (@{ $self->{plugins} }) { 
    79         if ( $plugin->handle($args) ) { 
     81    my @plugins = $handler ? ($handler) : @{ $self->{plugins} }; 
     82 
     83    for my $plugin (@plugins) { 
     84        if ( $handler || $plugin->handle($args) ) { 
    8085            $context->log(debug => $args->{entry}->permalink . " handled by " . $plugin->site_name); 
    8186            my $body = $plugin->extract_body($args->{content}); 
     
    112117package Plagger::Plugin::Filter::EntryFullText::Site; 
    113118sub new { bless {}, shift } 
     119sub handle_force { 0 } 
    114120 
    1151211;