・去年夏に届いた配当をようやく受け取り。
期限内に郵便局に行けずじまいでした…。(^^;
・私は、はてなRSSのヘビーユーザなのですが、
はてなへpingしないサイトは反映タイミングが遅い…。
手動更新機能があるのですが、面倒なので自動化。
以下のようなスクリプトで強制確認させています。
OPML形式でRSSフィードのリストをエキスポートして、
それをXMLパーサで処理して1つづつ確認しています。
あまり頻繁に実行するとサーバに負担がかかりそうなので
アレですが、1日に1度、使っています。参考になれば…。
#!/usr/local/bin/perl
# automatic hatena rss update
# 2006-05-03 gotospace
use strict;
use warnings;
use Jcode;
use XML::Parser;
use XML::SimpleObject;
use LWP::Simple;
my $content = 'opml.xml';
my $uri_feed = 'http://r.hatena.ne.jp/feed';
my $uri_check = 'http://r.hatena.ne.jp/check';
my $parser = XML::Parser->new(ErrorContext => 2, Style => 'Tree');
my $simobj = XML::SimpleObject->new($parser->parsefile($content));
check_outlines($simobj->child('opml')->child('body'));
sub check_outlines
{
my $outlines = shift;
my @outlines = $outlines->children('outline');
foreach my $outs (@outlines) {
my %atts = $outs->attributes();
if (exists($atts{'xmlUrl'})) {
my $xmlUrl = $outs->attribute('xmlUrl');
my $content = get("$uri_feed/$xmlUrl");
if ($content =~ /id="fid" value="([0-9]+)"/) {
my $fid = $1;
my $res = get("$uri_check?fid=$fid");
$res = jcode($res)->sjis;
print "$fid : $res\n";
}
}
if ($outs->children()) {
check_outlines($outs);
}
}
}
コメント
xfyが出荷されればこういったことに簡単に
対応できるということでしょうか。楽しみです。
xfy、面白そうですね。