2006-06-08
norkさんの*.txt日記を野良Atomに
最初はmod_autoindexからRSS生成しようとしたけど。過去ログみたらPerlで自作rdfを生成していたみたいなのでそれを利用
include: - /home/otsune/plagger/config.base.yaml plugins: - module: Subscription::Config config: feed: - url: http://blog.ninth-nine.com/topic.rdf # meta: # follow_link: \w+\.txt$ - module: CustomFeed::Simple - module: Filter::EntryFullText config: store_html_on_failure: 1 - module: Publish::Feed config: format: Atom dir: /home/otsune/public_html/plagger/feed filename: norks_daily.atom
元rdfにdateが無いので、Last-Modifiedヘッダーから日付をつけてほしいのだが、store_html_on_failureで無理に*.txtを読んでいるので
# failed to extract: store whole HTML if the config is on
if ($self->conf->{store_html_on_failure}) {
$args->{entry}->body($args->{content});
if ($res->last_modified) {
$args->{entry}->date( Plagger::Date->from_epoch($res->last_modified) );
}
return 1;
}
という感じに暫定的にした。うーんDRYじゃないし副作用有りそうでイヤーンな感じ。
追記: http://plagger.org/trac/changeset/940 で対応された
コメント
トラックバック - http://subtech.g.hatena.ne.jp/otsune/20060608
