root/trunk/plagger/assets/plugins/Filter-EntryFullText/ameblo_jp.pl

Revision 1933 (checked in by miyagawa, 1 year ago)

Force upgrade if the RSS feed content is "copyright protected"

Line 
1 sub handle_force {
2     my($self, $args) = @_;
3     return $args->{entry}->link =~ m!^http://ameblo\.jp/.*?/entry-\d+\.html!
4            and
5            $args->{entry}->body =~ m!\x{300e}\x{8457}\x{4f5c}\x{6a29}\x{4fdd}\x{8b77}\x{306e}\x{305f}\x{3081}\x{3001}\x{8a18}\x{4e8b}\x{306e}\x{4e00}\x{90e8}\x{306e}\x{307f}\x{8868}\x{793a}\x{3055}\x{308c}\x{3066}\x{304a}\x{308a}\x{307e}\x{3059}\x{3002}\x{300f}!;
6 }
7
8 sub handle {
9     my($self, $args) = @_;
10     $args->{entry}->link =~ qr!^http://ameblo\.jp/.*?/entry-\d+\.html!;
11 }
12
13 sub extract {
14     my($self, $args) = @_;
15
16     (my $content = $args->{content}) =~ s/\r\n/\n/g;
17     if ( $content =~ m/<div class="contents">(.*?)<\!--.*?-->/s ) {
18         return $1;
19     }
20 }
Note: See TracBrowser for help on using the browser.