root/trunk/plagger/assets/plugins/Filter-FindEnclosures/impress_watch.pl

Revision 906 (checked in by miyagawa, 2 years ago)

Impress Watch image finder

Line 
1 sub handle {
2     my ($self, $url) = @_;
3     $url =~ qr!watch\.impress\.co\.jp/cda/parts/image_for_link/!;
4 }
5
6 sub find {
7     my($self, $args) = @_;
8
9     if ($args->{content} =~ m!<IMG SRC="(/cda/static/image/.*?)"!i) {
10         my $enclosure = Plagger::Enclosure->new;
11         $enclosure->url( URI->new_abs($1, $args->{url}) );
12         $enclosure->auto_set_type;
13         return $enclosure;
14     }
15
16     return;
17 }
Note: See TracBrowser for help on using the browser.