/[irc-logger]/trunk/bin/irc-logger.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/irc-logger.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9 by dpavlin, Wed Mar 1 23:35:56 2006 UTC revision 10 by dpavlin, Thu Mar 2 00:19:12 2006 UTC
# Line 18  log all conversation on irc channel Line 18  log all conversation on irc channel
18    
19  ## CONFIG  ## CONFIG
20    
21  my $NICK = 'irc-logger-dev';  my $NICK = 'irc-logger';
22  my $CONNECT =  my $CONNECT =
23    {Server => 'irc.freenode.net',    {Server => 'irc.freenode.net',
24     Nick => $NICK,     Nick => $NICK,
# Line 115  POE::Session->create Line 115  POE::Session->create
115    
116                          $res = "usage: /msg $NICK stat - shows user statistics | /msg $NICK last - show backtrace of conversations";                          $res = "usage: /msg $NICK stat - shows user statistics | /msg $NICK last - show backtrace of conversations";
117    
118                    } elsif ($msg =~ m/^msg\s+(\S+)\s+(.*)$/i) {
119    
120                            print ">> /msg $1 $2\n";
121                            $_[KERNEL]->post( $IRC_ALIAS => privmsg => $1, $2 );
122                            $res = '';
123    
124                  } elsif ($msg =~ m/^stat.*?\s*(\d*)/i) {                  } elsif ($msg =~ m/^stat.*?\s*(\d*)/i) {
125    
126                          my $nr = $1 || 10;                          my $nr = $1 || 10;
# Line 198  POE::Session->create Line 204  POE::Session->create
204                  }                  }
205    
206          },          },
207            irc_477 => sub {
208                    print "# irc_477: ",$_[ARG1], "\n";
209                    $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "register $NICK" );
210            },
211          irc_505 => sub {          irc_505 => sub {
212          print "# irc_505: ",$_[ARG1], "\n";                  print "# irc_505: ",$_[ARG1], "\n";
213                  $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "register $NICK" );                  $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "register $NICK" );
214                  warn "## register $NICK\n";  #               $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "set hide email on" );
215    #               $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "set email dpavlin\@rot13.org" );
216          },          },
217          irc_registered => sub {          irc_registered => sub {
218                    warn "## indetify $NICK\n";
219                  $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "IDENTIFY $NICK" );                  $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "IDENTIFY $NICK" );
220            },
221            irc_433 => sub {
222                    print "# irc_433: ",$_[ARG1], "\n";
223                  warn "## indetify $NICK\n";                  warn "## indetify $NICK\n";
224                    $_[KERNEL]->post( $IRC_ALIAS => privmsg => 'nickserv', "IDENTIFY $NICK" );
225            },
226            irc_372 => sub {
227                    print "MOTD: ", $_[ARG1], "\n";
228            },
229            irc_snotice => sub {
230                    print "(server notice): ", $_[ARG0], "\n";
231          },          },
232      (map      (map
233       {       {
234         ;"irc_$_" => sub { }}         ;"irc_$_" => sub { }}
235       qw(join       qw(
         ctcp_version  
         connected snotice ctcp_action ping notice mode part quit  
         001 002 003 004 005  
         250 251 252 253 254 265 266  
         332 333 353 366 372 375 376  
                 477  
236                  )),                  )),
237    #       join
238    #       ctcp_version
239    #       connected snotice ctcp_action ping notice mode part quit
240    #       001 002 003 004 005
241    #       250 251 252 253 254 265 266
242    #       332 333 353 366 372 375 376
243    #       477
244      _child => sub {},      _child => sub {},
245      _default => sub {      _default => sub {
246        printf "%s: session %s caught an unhandled %s event.\n",        printf "%s: session %s caught an unhandled %s event.\n",

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26