Changeset 474

Show
Ignore:
Timestamp:
04/02/06 02:00:02
Author:
miyagawa
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/assets/plugins/filter-entryfulltext/asahi_com.pl

    r460 r474  
    55 
    66sub extract_body { 
    7     my($self, $content) = @_; 
    8     ( $content =~ /<!-- Start of Kiji -->(.*)<!-- End of Kiji -->/s )[0]; 
     7    my($self, $args) = @_; 
     8    ( $args->{content} =~ /<!-- Start of Kiji -->(.*)<!-- End of Kiji -->/s )[0]; 
    99} 
  • trunk/plagger/assets/plugins/filter-entryfulltext/hatena_diary.pl

    r468 r474  
    11sub handle { 
    22    my($self, $args) = @_; 
    3     #$args->{entry}->link =~ qr!^http://d\.hatena\.ne\.jp/!; 
     3    $args->{entry}->link =~ qr!^http://d\.hatena\.ne\.jp/!; 
    44} 
    55 
    66sub extract_body { 
    7     my($self, $content) = @_; 
    8     ( $content =~ /<\/h3>(.*?)<\/div>/s )[0]; 
     7    my($self, $args) = @_; 
     8    my $name     = ( $args->{entry}->link =~ /\#([\w\-]+)$/ )[0]; 
     9    my $day_only = $args->{entry}->link =~ qr!^http://d\.hatena\.ne\.jp/[\w\-]+/\d+/?$!; 
     10 
     11    my $match = 
     12         $name     ? qq!<h3><a href=".*?" name="$name">.*?</h3>(.*?)</div>! : 
     13         $day_only ? qq!<div class="section">(.*?)</div>! : 
     14                     qq!</h3>(.*?)</div>!; 
     15 
     16    if ( $args->{content} =~ /$match/s ){ 
     17        return "<div>$1</div>"; 
     18    } 
     19    return; 
    920} 
    1021 
  • trunk/plagger/assets/plugins/filter-entryfulltext/livedoorblog.pl

    r472 r474  
    55 
    66sub extract_body { 
    7     my($self, $content) = @_; 
     7    my($self, $args) = @_; 
    88 
    9     $content =~ s/\r\n/\n/g; 
     9    (my $content = $args->{content}) =~ s/\r\n/\n/g; 
    1010    if ( $content =~ m!<div class="main">(.*?)</div>\n\s*<a name="more"></a>\n\s*<div class="main">(.*?)<br clear="all">\n?</div>!s ) { 
    1111        return "<div>$1</div><div>$2</div>"; 
  • trunk/plagger/assets/plugins/filter-entryfulltext/sixapart.pl

    r463 r474  
    55 
    66sub extract_body { 
    7     my($self, $content) = @_; 
    8     my $body = ($content =~ m!<div class="entry-body-text">(.*?)</div>!s)[0]; 
    9     if ($body && ($content =~ m!<div class="entry-more-text">(.*?)</div>!s)[0]) { 
     7    my($self, $args) = @_; 
     8    my $body = ($args->{content} =~ m!<div class="entry-body-text">(.*?)</div>!s)[0]; 
     9    if ($body && ($args->{content} =~ m!<div class="entry-more-text">(.*?)</div>!s)[0]) { 
    1010        $body .= $1; 
    1111    } 
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r472 r474  
    8484        if ( $handler || $plugin->handle($args) ) { 
    8585            $context->log(debug => $args->{entry}->permalink . " handled by " . $plugin->site_name); 
    86             my $body = $plugin->extract_body($args->{content}); 
     86            my $body = $plugin->extract_body($args); 
    8787            if ($body) { 
    8888                $context->log(info => "Extract content succeeded on " . $args->{entry}->permalink); 
     
    118118sub new { bless {}, shift } 
    119119sub handle_force { 0 } 
     120sub handle { 0 } 
    120121 
    1211221;