/[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 111 by dpavlin, Sun Mar 9 22:12:06 2008 UTC revision 112 by dpavlin, Mon Mar 10 13:02:32 2008 UTC
# Line 160  my $filter = { Line 160  my $filter = {
160          },          },
161  };  };
162    
163    # POE IRC
164    my $poe_irc = POE::Component::IRC->spawn( %$irc_config ) or
165            die "can't start ", dump( $irc_config ), ": $!";
166    
167    my $irc = $poe_irc->session_id();
168    _log "IRC session_id $irc";
169    
170  my $dbh = DBI->connect($DSN,"","", { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr;  my $dbh = DBI->connect($DSN,"","", { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr;
171  $dbh->do( qq{ set client_encoding = 'UTF-8' } );  $dbh->do( qq{ set client_encoding = 'UTF-8' } );
172    
# Line 699  sub rss_fetch { Line 706  sub rss_fetch {
706                          }                          }
707                          my ( $type, $to ) = ( 'notice', $args->{channel} );                          my ( $type, $to ) = ( 'notice', $args->{channel} );
708                          ( $type, $to ) = ( 'privmsg', $args->{nick} ) if $args->{private};                          ( $type, $to ) = ( 'privmsg', $args->{nick} ) if $args->{private};
709                          _log(">> $type $to |", $msg);                          _log(">> $type $to", $msg);
710                          $args->{kernel}->post( irc => $type => $to, $msg );                          $args->{kernel}->post( $irc => $type => $to, $msg );
711                          $updates++;                          $updates++;
712                  }                  }
713          }          }
# Line 750  sub rss_check_updates { Line 757  sub rss_check_updates {
757  # seed rss seen cache so we won't send out all items on startup  # seed rss seen cache so we won't send out all items on startup
758  _log rss_fetch_all;  _log rss_fetch_all;
759    
 #  
 # POE handing part  
 #  
   
 my $poe_irc = POE::Component::IRC->spawn( %$irc_config ) or  
         die "can't start ", dump( $irc_config ), ": $!";  
   
 my $irc = $poe_irc->session_id();  
 _log "session_id $irc";  
   
760  POE::Session->create( inline_states => {  POE::Session->create( inline_states => {
761          _start => sub {                _start => sub {      
762                  $_[KERNEL]->post( $irc => register => 'all' );                  $_[KERNEL]->post( $irc => register => 'all' );
# Line 774  POE::Session->create( inline_states => { Line 771  POE::Session->create( inline_states => {
771          },          },
772      irc_255 => sub {    # server is done blabbing      irc_255 => sub {    # server is done blabbing
773                  $_[KERNEL]->post( $irc => join => $CHANNEL);                  $_[KERNEL]->post( $irc => join => $CHANNEL);
                 $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );  
774      },      },
775      irc_public => sub {      irc_public => sub {
776                  my $kernel = $_[KERNEL];                  my $kernel = $_[KERNEL];

Legend:
Removed from v.111  
changed lines
  Added in v.112

  ViewVC Help
Powered by ViewVC 1.1.26