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

Revision 634 (checked in by woremacx, 3 years ago)

gyao_content: add image

Line 
1 # author: woremacx
2 sub handle {
3     my($self, $args) = @_;
4     $args->{entry}->link =~ qr!^http://www.gyao.jp/sityou/catedetail/contents_id/cnt\d+/!;
5 }
6
7 sub extract {
8     my($self, $args) = @_;
9
10     (my $content = $args->{content}) =~ s/\r\n/\n/g;
11     my $body;
12
13     if ($content =~ m!(<img src="/img/info/\S+/cnt\d+_l.jpg" width="\d+" height="\d+">)!) {
14         $body .= "<div>".$1."</div>";
15     }
16     $content =~ s{<td align="left">(.+?)</td>}{
17         $body .= "<div>".$1."</div>" if $1 ne "\r\n";
18     }sge;
19
20     return $body;
21 }
Note: See TracBrowser for help on using the browser.