root/lang/perl/plagger/lib/Plagger/Plugin/Notify/XMPP.pm

Revision 618, 1.6 kB (checked in by hirose31, 12 months ago)

import Notify::XMPP::IKC (include bin/plagger-xmppbot) and Notify::XMPP::Direct

Line 
1package Plagger::Plugin::Notify::XMPP;
2use strict;
3use base qw( Plagger::Plugin );
4
5our $VERSION = '0.06';
6
7sub init {
8    my $self = shift;
9    $self->SUPER::init(@_);
10
11    my $class  = 'Plagger::Plugin::Notify::XMPP::' . ($self->conf->{direct} =~ /yes/i ? 'Direct' : 'IKC');
12    eval "require $class;";
13    if ($@) {
14        Plagger->context->error("failed to load $class");
15    }
16    bless $self, $class;
17}
18
19sub register {
20    my($self, $context) = @_;
21
22    $context->register_hook(
23        $self,
24        'plugin.init'      => $self->can('initialize'),
25        'publish.entry'    => $self->can('notify'),
26        'publish.finalize' => $self->can('finalize'),
27       );
28}
29
301;
31__END__
32
33=head1 NAME
34
35Plagger::Plugin::Notify::XMPP - Notify feed updates to XMPP client
36
37=head1 SYNOPSIS
38
39jabber.org
40
41  - module: Notify::XMPP
42    config:
43      jid: foo@jabber.org
44      password: plahplahplah
45      to:
46        - bar@jabber.org
47        - baz@gmail.com
48        - qux@jabber.jp
49
50Google Talk
51
52  - module: Notify::XMPP
53    config:
54      jid: foo@gmail.com
55      password: plahplahplah
56      server_host: talk.google.com
57      tls: 1
58      to:
59        - bar@jabber.org
60        - baz@gmail.com
61        - qux@jabber.jp
62
63If you want to connect server directly (not via plagger-xmppbot),
64add "direct: yes" to config section.
65
66=head1 DESCRIPTION
67
68This plugin allows you to notify feed updates to XMPP clients (jabber,
69Google Talk).
70
71=head1 AUTHOR
72
73HIROSE Masaaki (hirose31)
74
75=head1 SEE ALSO
76
77L<Plagger>, L<plagger-xmppbot>,
78L<Plagger::Plugin::Notify::XMPP::IKC>,
79L<Plagger::Plugin::Notify::XMPP::Direct>
80
81=cut
Note: See TracBrowser for help on using the browser.