Dear Home Owner, このページをアンテナに追加 RSSフィード

 | 

2006-03-01

Plagger Recipe: Publish Trac Update to IP Messenger  Plagger Recipe: Publish Trac Update to IP Messenger - Dear Home Owner, を含むブックマーク はてなブックマーク -  Plagger Recipe: Publish Trac Update to IP Messenger - Dear Home Owner,  Plagger Recipe: Publish Trac Update to IP Messenger - Dear Home Owner, のブックマークコメント

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

http://www.bsddiary.net/xipmsg/README

Plagger::Plugin::Notify::Command::Shutdown  Plagger::Plugin::Notify::Command::Shutdown - Dear Home Owner, を含むブックマーク はてなブックマーク -  Plagger::Plugin::Notify::Command::Shutdown - Dear Home Owner,  Plagger::Plugin::Notify::Command::Shutdown - Dear Home Owner, のブックマークコメント

Plagger::Plugin::Notify::Command

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;

Plagger::Plugin::Notify::Command::Shutdown

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

miyagawamiyagawa2006/03/01 14:54無関係だけど、
- feed:
- url: http...
- url: http...
で1個のBlockに複数かけます

youpyyoupy2006/03/01 15:05thanx

トラックバック - http://subtech.g.hatena.ne.jp/youpy/20060301
 |