Plagger::Plugin::Notify::YahooMessenger
Plagger::Plugin::Notify::YahooMessengerã
Yahoo! Messenger 㧠æ´æ°ãéç¥ã
ããããã®ããªï¼ï¼(Net::YahooMessengerã®ã¡ã³ãã miyagawa ããã ãã»ã»ã»)
è¦å½ãããªãã£ãã®ã§ä¸å¿ã
(ãã£ããããã¾ããã)
package Plagger::Plugin::Notify::YahooMessenger; use strict; use warnings; use base qw(Plagger::Plugin); use Net::YahooMessenger; sub register { my ($self, $context) = @_; $context->register_hook( $self, 'publish.feed' => \&update, ); } sub update { my ($self, $context, $args) = @_; my %param = ( id => $self->conf->{id}, password => $self->conf->{password}, ); $param{pre_login_url} = $self->conf->{pre_login_url} if exists $self->conf->{pre_login_url}; $param{hostname} = $self->conf->{hostname} if exists $self->conf->{hostname}; my $yahoo = Net::YahooMessenger->new(%param); $context->log(info => "Logging in to Yahoo! Messenger"); my $ret = $yahoo->login; unless ($ret) { $context->log(error => "Can't login Yahoo! Messenger"); return; } my $body = $self->templatize($context, $args->{feed}); $context->log(debug => $body); for my $line (split("\n", $body)) { $yahoo->send($self->conf->{recipient_id}, $line); } } sub templatize { my ($self, $context, $feed) = @_; my $tt = $context->template(); $tt->process('yahoo_messenger_notify.tt', { feed => $feed, }, \my $out) or $context->error($tt->error); $out; } 1; __END__ =head1 NAME Plagger::Plugin::Notify::YahooMessenger - Notify feed updates to Yahoo! Messenger =head1 SYNOPSIS - module: Notify::YahooMessenger config: id: your_yahoo_id password: foobar pre_login_url: http://edit.my.yahoo.co.jp/config/ hostname: cs.yahoo.co.jp recipient_id: your_another_yahoo_id =head1 DESCRIPTION This plugin notifies feed updates to Yahoo! Messenger =head1 AUTHOR Jiro Nishiguchi =head1 SEE ALSO L<Plagger>, L<Net::YahooMessenger> =cut
ã³ã¼ã㯠Notify::IRC ããã»ã¼ã³ããã
config ã¯
- module: Notify::YahooMessenger config: id: hoge password: hogehoge pre_login_url: http://edit.my.yahoo.co.jp/config/ hostname: cs.yahoo.co.jp recipient_id: hage
㧠assets/plugins/Notify-YahooMessenger/yahoo_messenger_notify.tt 㯠irc_notify.tt ãã³ãã¼ã
çµæ§ãããããã¾ãã¾ã使ããããã
ã¢ã«ã¦ã³ã2ã¤å¿ è¦ãªã®ãããã ãã©ã
ä»ã«ã CPAN ã¢ã¸ã¥ã¼ã«ãããã¡ãã»ã³ã¸ã£ã¼ç³»ã¯ç°¡åã«ã¤ããããã
追è¨
ãªãã¨ãªã Pod æ¸ããã