root/trunk/plagger/assets/plugins/Filter-EntryFullText/2ch.pl

Revision 582 (checked in by miyagawa, 3 years ago)

Add 2ch RSS filter and upgrader by youpy.
http://subtech.g.hatena.ne.jp/youpy/20060413/p1

Line 
1 # author: youpy
2 sub handle {
3     my($self, $args) = @_;
4     $args->{entry}->link =~ qr!^http://\w+\.2ch\.net/.*\d+/\d+$!;
5 }
6
7 sub extract {
8     my($self, $args) = @_;
9     if($args->{entry}->link =~ m!(\d+)$!) {
10         my $id = $1;
11         if ($args->{content} =~ m|<dt>($id.*)</dl>|s){
12             my $body = $1;
13             return "<div>$body</div>";
14         }
15     }
16     return;
17 }
Note: See TracBrowser for help on using the browser.