はてなブックマークで「あとで○○」とコメントしたエントリをメールする

微妙にGoogleで○○と検索すると○○:実用編のパクりっぽいけど、前からやりたかったことをやってみた。

global:
  timezone: Asia/Tokyo
  log:
    level: debug
  assets_path: /home/nozom/work/plagger/assets

plugins:
  - module: Aggregator::MyAggregator

  - module: Subscription::Config
    config:
      feed: http://b.hatena.ne.jp/nozom/rss

  - module: Filter::BreakEntriesToFeeds
    config:
      use_entry_title: 1

  - module: Filter::Rule
    rule:
       - expression: $args->{feed}->entries->[0]->summary =~ /^あとで/

  - module: Publish::Gmail
    config:
      mailto:   knzm.test@gmail.com
      mailfrom: knzm.test+plagger@gmail.com
      mailroute:
        via: smtp
        host: localhost

RSSのdescriptionフィールドの情報が取れなかったので、Plagger::Plugin::Aggregator::Simpleに以下のようなパッチを当てた(もっと良いやり方があるのかもしれないけど)。

--- /usr/local/CPAN/lib/perl5/Plagger/Plugin/Aggregator/Simple.pm       2006-09-15 18:12:46.000000000 +0900
+++ Plagger/Plugin/Aggregator/MyAggregator.pm   2006-10-13 11:33:29.000000000 +0900
@@ -1,4 +1,4 @@
-package Plagger::Plugin::Aggregator::Simple;
+package Plagger::Plugin::Aggregator::MyAggregator;
 use strict;
 use base qw( Plagger::Plugin );

@@ -108,6 +108,8 @@
         $entry->title(_u($e->title));
         $entry->author(_u($e->author));

+        $entry->summary(_u($e->{entry}->{description}));
+
         my $category = $e->category;
            $category = [ $category ] if $category && (!ref($category) || ref($category) ne 'ARRAY');
         $entry->tags([ map _u($_), @$category ]) if $category;

(Plaggerのバージョンは0.7.12)

最初どこを直せばいいのか全く見当が付かず、SmartFeedやFilter::Ruleを闇雲に書き換えているうちにここの説明を見つけて、なんとなく動作を理解した。
それと、キャッシュ等の情報が書き込まれる場所が分からなくてハマった。試行錯誤の結果、どうやらデフォルトだと~/.plagger/、-cオプション付きでplaggerを起動すると~/.plagger-{configファイル名}/になるらしい。