Changeset 1232
- Timestamp:
- 08/08/06 12:51:31
- Files:
-
- trunk/plagger/assets/plugins/Notify-IRC/irc_notify.tt (modified) (1 diff)
- trunk/plagger/lib/Plagger/Plugin/Notify/IRC.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/assets/plugins/Notify-IRC/irc_notify.tt
r1043 r1232 1 1 [%- SET title = feed.title || '(no-title)' -%] 2 [% FOREACH entry = feed.entries -%][% feed.title_text %]: [% entry.title_text %] - [% entry.link %][% IF entry.author %] by [% entry.author %][% END %] 3 [% END -%] 2 [% feed.title_text %]: [% entry.title_text %] - [% entry.link %][% IF entry.author %] by [% entry.author %][% END %] trunk/plagger/lib/Plagger/Plugin/Notify/IRC.pm
r1173 r1232 10 10 $context->register_hook( 11 11 $self, 12 'publish.feed' => \&update, 12 'publish.entry' => \&update, 13 'plugin.init' => \&initialize, 13 14 ); 14 15 } 15 16 16 sub update {17 sub initialize { 17 18 my($self, $context, $args) = @_; 18 19 … … 20 21 my $port = $self->conf->{daemon_port} || 9999; 21 22 22 my $remote= POE::Component::IKC::ClientLite::create_ikc_client(23 $self->{remote} = POE::Component::IKC::ClientLite::create_ikc_client( 23 24 port => $port, 24 25 ip => $host, … … 27 28 ); 28 29 29 unless ($ remote) {30 unless ($self->{remote}) { 30 31 my $msg = q{unable to connect to plagger-ircbot process on } 31 32 . "$host:$port" … … 36 37 return; 37 38 } 39 } 38 40 39 $context->log(info => "Notifying " . $args->{feed}->title . " to IRC"); 41 sub update { 42 my($self, $context, $args) = @_; 40 43 41 my $body = $self->templatize('irc_notify.tt', { feed => $args->{feed} }); 44 $context->log(info => "Notifying " . $args->{entry}->title . " to IRC"); 45 46 my $body = $self->templatize('irc_notify.tt', $args); 42 47 Encode::_utf8_off($body) if Encode::is_utf8($body); 43 48 Encode::from_to($body, 'utf-8', $self->conf->{charset})
