「yahoo.pl」の編集履歴(バックアップ)一覧はこちら
「yahoo.pl」(2009/01/17 (土) 19:56:21) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
//perl
use Web::Scraper;
sub init {
my $self = shift;
$self->{handle} = "/videonews/";
}
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;
}
//perl
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;
}