Changeset 474
- Timestamp:
- 04/02/06 02:00:02
- Files:
-
- trunk/plagger/assets/plugins/filter-entryfulltext/asahi_com.pl (modified) (1 diff)
- trunk/plagger/assets/plugins/filter-entryfulltext/hatena_diary.pl (modified) (1 diff)
- trunk/plagger/assets/plugins/filter-entryfulltext/livedoorblog.pl (modified) (1 diff)
- trunk/plagger/assets/plugins/filter-entryfulltext/sixapart.pl (modified) (1 diff)
- trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/assets/plugins/filter-entryfulltext/asahi_com.pl
r460 r474 5 5 6 6 sub 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]; 9 9 } trunk/plagger/assets/plugins/filter-entryfulltext/hatena_diary.pl
r468 r474 1 1 sub handle { 2 2 my($self, $args) = @_; 3 #$args->{entry}->link =~ qr!^http://d\.hatena\.ne\.jp/!;3 $args->{entry}->link =~ qr!^http://d\.hatena\.ne\.jp/!; 4 4 } 5 5 6 6 sub 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; 9 20 } 10 21 trunk/plagger/assets/plugins/filter-entryfulltext/livedoorblog.pl
r472 r474 5 5 6 6 sub extract_body { 7 my($self, $ content) = @_;7 my($self, $args) = @_; 8 8 9 $content=~ s/\r\n/\n/g;9 (my $content = $args->{content}) =~ s/\r\n/\n/g; 10 10 if ( $content =~ m!<div class="main">(.*?)</div>\n\s*<a name="more"></a>\n\s*<div class="main">(.*?)<br clear="all">\n?</div>!s ) { 11 11 return "<div>$1</div><div>$2</div>"; trunk/plagger/assets/plugins/filter-entryfulltext/sixapart.pl
r463 r474 5 5 6 6 sub 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]) { 10 10 $body .= $1; 11 11 } trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm
r472 r474 84 84 if ( $handler || $plugin->handle($args) ) { 85 85 $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); 87 87 if ($body) { 88 88 $context->log(info => "Extract content succeeded on " . $args->{entry}->permalink); … … 118 118 sub new { bless {}, shift } 119 119 sub handle_force { 0 } 120 sub handle { 0 } 120 121 121 122 1;
