App-Pocoirc

 view release on metacpan or  search on metacpan

lib/App/Pocoirc.pm  view on Meta::CPAN


=head1 CONFIGURATION

 nick:     foobar1234
 username: foobar
 log_file: /my/log.file
 lib:      /my/modules

 global_plugins:
   - [CTCP]

 local_plugins:
   - [BotTraffic]

 networks:
   freenode:
     server: irc.freenode.net
     local_plugins:
       - [AutoJoin, { Channels: ['#foodsfdsf'] } ]
   magnet:
     server: irc.perl.org
     nick:   hlagherf32fr

The configuration file is in L<YAML|YAML> or L<JSON|JSON> format. It consists
of a hash containing C<global_plugins>, C<local_plugins>, C<networks>, C<lib>,
C<log_file>, C<class>, and default parameters to
L<POE::Component::IRC|POE::Component::IRC/spawn>. Only C<networks> is
required.

C<lib> is either the name of a directory containing Perl modules (e.g.
plugins), or an array of such names. Kind of like Perl's I<-I>.

C<log_file> is the path to a log file to which status messages will be written.

C<class> is the IRC component class. Defaults to
L<POE::Component::IRC::State|POE::Component::IRC::State>.

=head2 Networks

The C<networks> option should be a hash of network hashes. The keys are the
names of the networks. A network hash can contain C<local_plugins> and
parameters to POE::Component::IRC. None are required, except C<server> if not
defined at the top level. The POE::Component::IRC parameters specified in this
hash will override the ones specified at the top level.

=head2 Plugins

The C<global_plugins> and C<local_plugins> options should consist of an array
containing the short plugin class name (e.g. 'AutoJoin') and optionally a hash
of arguments to that plugin. When figuring out the correct package name,
App::Pocoirc will first try to load POE::Component::IRC::Plugin::I<YourPlugin>
before trying to load I<YourPlugin>.

The plugins in C<global_plugins> will be instantiated once and then added to
all IRC components. B<Note:> not all plugins are designed to be used with
multiple IRC components simultaneously.

If you specify C<local_plugins> at the top level, it will serve as a default
list of local plugins, which can be overridden in a network hash.

=head1 OUTPUT

Here is some example output from the program:

 $ pocoirc -f example/config.yml
 2011-04-18 18:10:52 Started (pid 20105)
 2011-04-18 18:10:52 Constructing global plugins
 2011-04-18 18:10:52 [freenode]  Constructing local plugins
 2011-04-18 18:10:52 [freenode]  Spawning IRC component (POE::Component::IRC::State)
 2011-04-18 18:10:52 [magnet]    Constructing local plugins
 2011-04-18 18:10:52 [magnet]    Spawning IRC component (POE::Component::IRC::State)
 2011-04-18 18:10:52 [freenode]  Registering plugins
 2011-04-18 18:10:52 [magnet]    Registering plugins
 2011-04-18 18:10:52 [freenode]  Connecting to IRC (irc.freenode.net)
 2011-04-18 18:10:52 [magnet]    Connecting to IRC (irc.perl.org)
 2011-04-18 18:10:52 [freenode]  Added plugin Whois3
 2011-04-18 18:10:52 [freenode]  Added plugin ISupport3
 2011-04-18 18:10:52 [freenode]  Added plugin DCC3
 2011-04-18 18:10:52 [magnet]    Added plugin Whois5
 2011-04-18 18:10:52 [magnet]    Added plugin ISupport5
 2011-04-18 18:10:52 [magnet]    Added plugin DCC5
 2011-04-18 18:10:52 [freenode]  Added plugin CTCP1
 2011-04-18 18:10:52 [freenode]  Added plugin AutoJoin1
 2011-04-18 18:10:52 [freenode]  Added plugin PocoircStatus1
 2011-04-18 18:10:52 [magnet]    Added plugin CTCP1
 2011-04-18 18:10:52 [magnet]    Added plugin PocoircStatus1
 2011-04-18 18:10:52 [magnet]    Connected to server irc.perl.org
 2011-04-18 18:10:52 [magnet]    Server notice: *** Looking up your hostname...
 2011-04-18 18:10:52 [magnet]    Server notice: *** Checking Ident
 2011-04-18 18:10:52 [freenode]  Connected to server irc.freenode.net
 2011-04-18 18:10:53 [magnet]    Server notice: *** Found your hostname
 2011-04-18 18:10:53 [freenode]  Server notice: *** Looking up your hostname...
 2011-04-18 18:10:53 [freenode]  Server notice: *** Checking Ident
 2011-04-18 18:10:53 [freenode]  Server notice: *** Couldn't look up your hostname
 2011-04-18 18:11:03 [magnet]    Server notice: *** No Ident response
 2011-04-18 18:11:03 [magnet]    Logged in to server magnet.shadowcat.co.uk with nick hlagherf32fr
 2011-04-18 18:11:07 [freenode]  Server notice: *** No Ident response
 2011-04-18 18:11:07 [freenode]  Logged in to server niven.freenode.net with nick foobar1234
 2011-04-18 18:11:11 [freenode]  Joined channel #foodsfdsf
 ^C2011-04-18 18:11:22 Exiting due to SIGINT
 2011-04-18 18:11:22 Waiting up to 5 seconds for IRC server(s) to disconnect us
 2011-04-18 18:11:22 [magnet]    Error from IRC server: Closing Link: 212-30-192-157.static.simnet.is ()
 2011-04-18 18:11:22 [magnet]    Deleted plugin DCC5
 2011-04-18 18:11:22 [magnet]    Deleted plugin ISupport5
 2011-04-18 18:11:22 [magnet]    Deleted plugin CTCP1
 2011-04-18 18:11:22 [magnet]    Deleted plugin Whois5
 2011-04-18 18:11:22 [magnet]    Deleted plugin PocoircStatus1
 2011-04-18 18:11:22 [magnet]    IRC component shut down
 2011-04-18 18:11:22 [freenode]  Quit from IRC (Client Quit)
 2011-04-18 18:11:22 [freenode]  Error from IRC server: Closing Link: 212.30.192.157 (Client Quit)
 2011-04-18 18:11:22 [freenode]  Deleted plugin AutoJoin1
 2011-04-18 18:11:22 [freenode]  Deleted plugin CTCP1
 2011-04-18 18:11:22 [freenode]  Deleted plugin DCC3
 2011-04-18 18:11:22 [freenode]  Deleted plugin PocoircStatus1
 2011-04-18 18:11:22 [freenode]  Deleted plugin Whois3
 2011-04-18 18:11:22 [freenode]  Deleted plugin ISupport3
 2011-04-18 18:11:22 [freenode]  IRC component shut down

=head1 AUTHOR

Hinrik E<Ouml>rn SigurE<eth>sson, hinrik.sig@gmail.com



( run in 0.694 second using v1.01-cache-2.11-cpan-39bf76dae61 )