Plaggerのプラグイン,Notify::Growlがクール.Growlもクール.次のようなかんじ.
たとえば,dameTunes更新状況の更新をGrowlでNotifyするのには次のようなyaml書いた.
plugins: - module: Subscription::Config config: feed: - http://dmng.dcc-jpl.com/natsumican.rdf - module: Filter::Rule rule: module: Fresh mtime: path: /tmp/dmngantenna.tmp autoupdate: 1 - module: Notify::Growl
しかし,Notify::Growlは日本語含んだFeedを扱うとウマく動いてくれないようだ.文字化けならともかく,まったくNotifyされなくなるので良くない.Plagger::Plugin::Publish::Growl : blog.nomadscafe.jpの下の方の画像をみると,日本語Feedも扱えているよう.自分の環境が悪いのかGrowlがバージョンアップしたせいなのか.
コレをどうにかすべく,Notify::Growlの文字コードのまわりをいろいろいじってみたのだが,どうもうまくいかない.で,とりあえず動かすためにFeedのタイトルを使う代わりにFeedのURLを使うようにしちゃった.とりあえず,動くし,Feedの見分けもまぁつく.次のようにちょびっといじった,てかtitle_textをurlに変えただけだけどナー
$ svn diff -r HEAD lib/Plagger/Plugin/Notify/Growl.pm Index: lib/Plagger/Plugin/Notify/Growl.pm =================================================================== --- lib/Plagger/Plugin/Notify/Growl.pm (リビジョン 964) +++ lib/Plagger/Plugin/Notify/Growl.pm (作業コピー) @@ -19,7 +19,7 @@ my ($self, $context) = @_; my @updates; for my $update ($context->update->feeds){ - push @updates, encode_utf8($update->title_text); + push @updates, encode_utf8($update->url); } Mac::Growl::RegisterNotifications("plagger", [@updates],[@updates]); } @@ -28,7 +28,7 @@ my($self, $context, $args) = @_; Mac::Growl::PostNotification( "plagger", - encode_utf8($args->{feed}->title_text), + encode_utf8($args->{feed}->url), encode_utf8($args->{entry}->title_text), encode_utf8($args->{entry}->body_text) );
例ではdameTunes更新状況を取り上げた.実は,#dameTunesではdameTunes更新状況の更新がIRCで通知されるのであんまり必要なかったりするんだけど.あ,でもそれもPlaggerで(ry*1.
*1:言ってみたかっただけ