technobahn.comのEFTで「続きを読む」対応
http://www.karashi.org/~poppen/d/20070323.htmlより。
technobahn.comがまた変更されたみたい
続きを読むをクリックしないと、全文が表示されないようになっていた。
technobahn.com用EFTをupdateしたいけれども、俺の力じゃ歯が立たなそうな悪寒。
いまのところ、こんなの(↓)をYAMLのかわりにEFTのassetにすれば取れるようです。ただし、以前の倍のリクエストを出すので、ぶん回しているとまた蹴られるようになる可能性も。
technobahn_com.pl
use Plagger::Util qw( decode_content );
sub handle {
my($self, $args) = @_;
$args->{entry}->link =~ m|http://www\.technobahn\.com/cgi-bin/news/read2\?f=\d+|;
}
sub extract {
my($self, $args) = @_;
my $content;
if (my ($url) =
$args->{content} =~ m|<form name="myFORM" action="([^"]*)"|) {
my $ua = Plagger::UserAgent->new;
my $res = $ua->post($url, { continue => 'y' });
return if $res->is_error;
$content = decode_content($res->content);
} else {
$content = $args->{content};
}
if ($content =~ m|<td bgcolor="#ffffff" height="10%" valign=top>(.*?)<div id="layer-zoomin" style="position:absolute; z-index:2; visibility: hidden">|ms) {
return $1;
}
return;
}
追記:2009-05-12
その後さらにサイトが変更になって、poppenさんがご自分で対応されたようです。すばらしい。
コメント
コメントの投稿
トラックバック
http://emasaka.blog65.fc2.com/tb.php/211-70b27b35
technobahn.comの「続きを読む」に対応して頂いた!
こないだの件の続き。emasakaさんから、technobahn.comのEFTで「続きを読む」に対応した、とのTBを頂いた。うひょー、これは凄い。emasakaさん、どうもありがとうございます。m(_)mなるほど、こう書けばいいのか。勉強になるなー。
