/[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 126 by dpavlin, Fri Mar 14 16:06:57 2008 UTC revision 129 by dpavlin, Fri Mar 14 17:44:23 2008 UTC
# Line 1005  POE::Session->create( inline_states => { Line 1005  POE::Session->create( inline_states => {
1005    
1006                          my $sql = {                          my $sql = {
1007                                  add     => qq{ insert into feeds (url,name,channel,nick,private) values (?,?,?,?,?) },                                  add     => qq{ insert into feeds (url,name,channel,nick,private) values (?,?,?,?,?) },
1008  #                               remove  => qq{ delete from feeds                                where url = ? and name = ? },                                  remove  => qq{ delete from feeds                                where url = ? and nick = ? },
1009                                  start   => qq{ update feeds set active = true   where url = ? },                                  start   => qq{ update feeds set active = true   where url = ? },
1010                                  stop    => qq{ update feeds set active = false  where url = ? },                                  stop    => qq{ update feeds set active = false  where url = ? },
1011                                  clean   => qq{ update feeds set last_update = now() - delay where url = ? },                                  clean   => qq{ update feeds set last_update = now() - delay where url = ? },
# Line 1018  POE::Session->create( inline_states => { Line 1018  POE::Session->create( inline_states => {
1018                                  my @data = ( $url );                                  my @data = ( $url );
1019                                  if ( $command eq 'add' ) {                                  if ( $command eq 'add' ) {
1020                                          push @data, ( $arg, $channel, $nick, $sub eq 'private' ? 1 : 0 );                                          push @data, ( $arg, $channel, $nick, $sub eq 'private' ? 1 : 0 );
1021                                    } elsif ( $command eq 'remove' ) {
1022                                            push @data, $nick;
1023                                  }                                  }
1024                                  warn "## $command SQL $q with ",dump( @data ),"\n";                                  warn "## $command SQL $q with ",dump( @data ),"\n";
1025                                  eval { $sth->execute( @data ) };                                  eval { $sth->execute( @data ) };
1026                                  if ($@) {                                  if ($@) {
1027                                          $res = "ERROR: $@";                                          $res = "ERROR: $@";
1028                                  } else {                                  } else {
1029                                          $res = "OK, RSS executed $command" . ( $sub ? "-$sub" : '' ) ." on $channel url $url";                                          $res = "OK, RSS executed $command" .
1030                                                    ( $sub ? "-$sub " : ' ' ) .
1031                                                    ( $channel ? "on $channel " : '' ) .
1032                                                    "url $url";
1033                                          if ( $command eq 'clean' ) {                                          if ( $command eq 'clean' ) {
1034                                                  my $seen = $_stat->{rss}->{seen} || die "no seen?";                                                  my $seen = $_stat->{rss}->{seen} || die "no seen?";
1035                                                  my $want_link = $_stat->{rss}->{url2link}->{$url} || warn "no url2link($url)";                                                  my $want_link = $_stat->{rss}->{url2link}->{$url} || warn "no url2link($url)";

Legend:
Removed from v.126  
changed lines
  Added in v.129

  ViewVC Help
Powered by ViewVC 1.1.26