| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Notify::Beep - Beep your computer when feed arrives
- module: Notify::Beep
config:
music: "g' f bes' c8 f d4 c8 f d4 bes c g f2"
Beep your computer when feed arrives.
When it is set, beep tries to play a melody specified as Lilypond notation. Defaults to nothing and in that case, it just beeps.
Tatsuhiko Miyagawa
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Notify::Beep; use strict; use base qw( Plagger::Plugin ); use Audio::Beep; sub register { my($self, $context) = @_; $context->register_hook( $self, 'publish.feed' => \&update, 'publish.finalize' => \&finalize, ); $self->{count} = 0; } sub update { my($self, $context, $args) = @_; $self->{count}++ if $args->{feed}->count; } sub finalize { my($self, $context, $args) = @_; if ($self->{count}) { if ($self->conf->{music}) { Audio::Beep->new->play($self->conf->{music}); } else { Audio::Beep::beep; } } } 1; __END__