use Web::Scraper; sub init { my $self = shift; $self->{domain} = "headlines.yahoo.co.jp"; $self->{handle} = "/videonews/"; } sub needs_content { 1 } sub find { my ($self, $args) = @_; my $res = scraper { process "//a[contains(\@href, 'wm300k')]", movie => '@href'; process "//img[\@width='320' and \@height='240']", thumbnail => '@src'; }->scrape($args->{content}, $args->{url}); my $enclosure = Plagger::Enclosure->new; $enclosure->url($res->{movie}); $enclosure->type("video/x-ms-wmv"); $enclosure->thumbnail({ url => $res->{thumbnail} }); return $enclosure; }