|
|
||
config.yaml
... plugins: - module: Subscription::Config config: feed: - url: http://xxx.xxx.xxx.xxx/projects/proj1/timeline?milestone=on&ticket=on&changeset=on&wiki=on&max=50&daysback=90&format=rss - url: http://xxx.xxx.xxx.xxx/projects/proj2/timeline?milestone=on&ticket=on&changeset=on&wiki=on&max=50&daysback=90&format=rss - module: SmartFeed config: id: fresh rule: module: Fresh duration: 5 - module: Publish::Pipe rule: expression: $args->{feed}->id eq 'fresh' config: command: /usr/bin/udpmsg yyy.yyy.yyy.255 encoding: euc-jp
lib/Plagger/Plugin/Notify/Command.pm
package Plagger::Plugin::Notify::Command; use strict; use base qw( Plagger::Plugin ); sub register { my($self, $context) = @_; $context->register_hook( $self, 'publish.feed' => \&update, 'publish.finalize' => $self->can('command'), ); } sub update { my ($self, $context, $args) = @_; $self->{count}++ if $args->{feed}->count; } 1;
lib/Plagger/Plugin/Notify/Command/Shutdown.pm
package Plagger::Plugin::Notify::Command::Shutdown; use strict; use base qw( Plagger::Plugin::Notify::Command ); sub command { my ($self, $context, $args) = @_; system qq(shutdown -h now "You've got feed!") if $self->{count}; } 1;
config.yaml
- module: Notify::Command::Shutdown
You need to run Plagger as root.
thanx id:tokuhirom, typestar
- feed:
- url: http...
- url: http...
で1個のBlockに複数かけます