NAME
cpan_bot - an IRC CPAN Info bot
DESCRIPTION
An IRC bot to report recent uploads to PAUSE and provide information about CPAN authors/distributions/modules, as well as gives out links to documentation on http://search.cpan.org/
USAGE
perl cpan_bot.pl
CONFIG
The config file is a file containing a simple hashref which the script will do''
default location the script will look for is ~/.cpan_bot/config however the path can be changed via enviromental variable CPAN_BOT_DIR
, thus config file will be located at "$CPAN_BOT_DIR/config"
The sample config file is as follows:
{
nick => 'CPAN2',
server => 'irc.freenode.net',
port => 6667,
ircname => 'CPAN bot',
no_pastebins => 1,
do_nickserv => 1,
nickserv_pass => 'passo-word',
channels => [ '#zofbot' ],
PAUSE_options => [
store => '/home/zoffix/.cpan_bot/pause.data',
login => 'ZOFFIX',
pass => 'passo-word',
interval => 600,
channels => [ '#zofbot' ],
],
CPANInfo_options => [
path => '/home/zoffix/.cpan_bot/',
],
CPANLinks_to_docs_options => [
obj_args => { db_file => '/home/zoffix/.cpan_bot/links.db' }
],
OutputToPastebin_options => [ max_tries => 10 ],
}
- nick
-
Bot's nickname. Note: POE::Component::IRC::NickReclaim is used, thus if
nick
is taken, bot will usenick
with an underscore appended. - server
-
The IRC server to connect to.
- port
-
The port of IRC server to connect to.
- ircname
-
Whatever it is, will be passed to POE::Component::IRC constructor as a value for 'ircname'
- no_pastebins
-
When too many dists are uploaded plugin will say "Total of this many dists were uploaded see http://link_to_pastebin/blah"; set
no_pastebins
option to a true value if you want to disable pastebinning of "flood" uploads. - do_nickserv
-
This is was developed for FreeNode IRC network. If set to a true value will identify with services before joining any channels. Not tested on any other networks, make sure to set to
0
if you can't identify or bot will not join anything. - nickserv_pass
-
Password to use for identification with NickServ. Ignored if
do_nickserv
is set to a false value. - channels
-
Takes an arrayref of channels to join.
- PAUSE_options
-
Takes an arrayref, this is what to pass to POE::Component::IRC::Plugin::PAUSE::RecentUploads constructor. Beware that
fetched_event
,report_event
andquiet_flood
options are overriden by the bot. - CPANInfo_options
-
Takes an arrayref, this is what to pass to POE::Component::IRC::Plugin::CPAN::Info constructor.
- CPANLinks_to_docs_options
-
Takes an arrayref, this is what to pass to POE::Component::IRC::Plugin::CPAN::LinksToDocs::No404s::Remember constructor.
- OutputToPastebin_options
-
Takes an arrayref, this is what to pass to POE::Component::IRC::Plugin::OutputToPastebin constructor
- WWW_CPAN_Options
-
Takes an arrayref, this is what to pass POE::Component::IRC::Plugin::WWW::CPAN constructor.
SEE ALSO
The functionality can be understood by reading at least the description of the following PoCo::IRC plugins which this bot uses:
POE::Component::IRC::Plugin::PAUSE::RecentUploads POE::Component::IRC::Plugin::CPAN::Info POE::Component::IRC::Plugin::Connector POE::Component::IRC::Plugin::NickReclaim POE::Component::IRC::Plugin::BotAddressed POE::Component::IRC::Plugin::CPAN::LinksToDocs::No404s::Remember POE::Component::IRC::Plugin::OutputToPastebin POE::Component::IRC::Plugin::WWW::CPAN
BUGS
So far none were spotted. Once the bot didn't want to fetch any info files used by POE::Component::IRC::Plugin::CPAN::Info on a FreeBSD box. Magically the bug disappeared after a reboot. I blame it on the box, but if you spot something similiar let me know. Thanks.
AUTHOR
Zoffix Znet <zoffix@cpan.org> ( http://zoffix.com, http://haslayout.net )
LICENSE
Same as Perl