otsune's SnakeOil RSSフィード

python -c "print''.join([chr(x) for x in 111&1101,110+~-~11,10^11*11,110+~-~11,-~101,-~11^11*11,~-110,111&11*11,11+11+10,11|~-0110,1-~11^11*11,10^11*11,-~11^11*11,110,101])"

2006-06-08

norkさんの*.txt日記を野良Atomに

 norkさんの*.txt日記を野良Atomに - otsune's SnakeOil  を含むブックマーク はてなブックマーク -  norkさんの*.txt日記を野良Atomに - otsune's SnakeOil   norkさんの*.txt日記を野良Atomに - otsune's SnakeOil  のブックマークコメント

最初は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