Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 98dc6be526fd8873d226334a68f183f2 > files > 13

perl-POE-Component-IRC-6.900.0-3.mga7.noarch.rpm

#!/usr/bin/perl

# This is the most succinct IRC logger bot script in the history of the universe
# Author: Hinrik Örn Sigurðsson, <hinrik.sig@gmail.com>

use strict;
use warnings;
use POE;
use POE::Component::IRC::State;
use POE::Component::IRC::Plugin::AutoJoin;
use POE::Component::IRC::Plugin::Logger;

my $nick = 'mylogbot';
my $server = 'irc.blahblah.irc';
my @channels = ('#chan1', '#chan2');
my $path = "$ENV{HOME}/irclogs";

my $irc = POE::Component::IRC::State->spawn(
    Server => $server,
    Nick => $nick,
);
$irc->plugin_add('AutoJoin', POE::Component::IRC::Plugin::AutoJoin->new( Channels => \@channels ));
$irc->plugin_add('Logger', POE::Component::IRC::Plugin::Logger->new( Path => $path ));
$irc->yield('connect');

$poe_kernel->run();