/[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 112 by dpavlin, Mon Mar 10 13:02:32 2008 UTC revision 123 by dpavlin, Fri Mar 14 14:45:04 2008 UTC
# Line 2  Line 2 
2  use strict;  use strict;
3  $|++;  $|++;
4    
5  use POE qw(Component::IRC Component::Server::HTTP);  use POE qw(Component::IRC Component::Server::HTTP Component::Client::HTTP);
6  use HTTP::Status;  use HTTP::Status;
7  use DBI;  use DBI;
8  use Regexp::Common qw /URI/;  use Regexp::Common qw /URI/;
# Line 18  use DateTime::Format::ISO8601; Line 18  use DateTime::Format::ISO8601;
18  use Carp qw/confess/;  use Carp qw/confess/;
19  use XML::Feed;  use XML::Feed;
20  use DateTime::Format::Flexible;  use DateTime::Format::Flexible;
21    use IPC::DirQueue;
22    use File::Slurp;
23    use Encode;
24    
25  =head1 NAME  =head1 NAME
26    
# Line 47  log all conversation on irc channel Line 50  log all conversation on irc channel
50    
51  ## CONFIG  ## CONFIG
52    
53    my $debug = 0;
54    
55  my $irc_config = {  my $irc_config = {
56          nick => 'irc-logger',          nick => 'irc-logger',
57          server => 'irc.freenode.net',          server => 'irc.freenode.net',
# Line 54  my $irc_config = { Line 59  my $irc_config = {
59          ircname => 'Anna the bot: try /msg irc-logger help',          ircname => 'Anna the bot: try /msg irc-logger help',
60  };  };
61    
62    my $queue_dir = './queue';
63    
64  my $HOSTNAME = `hostname -f`;  my $HOSTNAME = `hostname -f`;
65  chomp($HOSTNAME);  chomp($HOSTNAME);
66    
# Line 61  chomp($HOSTNAME); Line 68  chomp($HOSTNAME);
68  my $CHANNEL = '#razmjenavjestina';  my $CHANNEL = '#razmjenavjestina';
69    
70  if ( $HOSTNAME =~ m/llin/ ) {  if ( $HOSTNAME =~ m/llin/ ) {
71          $irc_config->{nick} = 'irc-logger-dev';          $irc_config->{nick} = 'irc-logger-llin';
72  #       $irc_config = {  #       $irc_config = {
73  #               nick => 'irc-logger-dev',  #               nick => 'irc-logger-llin',
74  #               server => 'localhost',  #               server => 'localhost',
75  #               port => 6668,  #               port => 6668,
76  #       };  #       };
# Line 75  if ( $HOSTNAME =~ m/llin/ ) { Line 82  if ( $HOSTNAME =~ m/llin/ ) {
82    
83  my @channels = ( $CHANNEL );  my @channels = ( $CHANNEL );
84    
85  warn "# config = ", dump( $irc_config ), $/;  warn "## config = ", dump( $irc_config ) if $debug;
86    
87  my $NICK = $irc_config->{nick} or die "no nick?";  my $NICK = $irc_config->{nick} or die "no nick?";
88    
# Line 106  my $log_path; Line 113  my $log_path;
113  GetOptions(  GetOptions(
114          'import-dircproxy:s' => \$import_dircproxy,          'import-dircproxy:s' => \$import_dircproxy,
115          'log:s' => \$log_path,          'log:s' => \$log_path,
116            'queue:s' => \$queue_dir,
117            'debug!' => \$debug,
118  );  );
119    
120  #$SIG{__DIE__} = sub {  #$SIG{__DIE__} = sub {
121  #       confess "fatal error";  #       confess "fatal error";
122  #};  #};
123    
 open(STDOUT, '>', $log_path) || warn "can't redirect log to $log_path: $!";  
   
124  sub _log {  sub _log {
125          print strftime($TIMESTAMP,localtime()) . ' ' . join(" ",@_) . $/;          print strftime($TIMESTAMP,localtime()) . ' ' . join(" ",map { ref($_) ? dump( $_ ) : $_ } @_) . $/;
126    }
127    
128    open(STDOUT, '>', $log_path) && warn "log to $log_path: $!\n";
129    
130    # queue
131    
132    if ( ! -d $queue_dir ) {
133            warn "## creating queue directory $queue_dir";
134            mkdir $queue_dir or die "can't create queue directory $queue_dir: $!";
135  }  }
136    
137    my $dq = IPC::DirQueue->new({ dir => $queue_dir });
138    
139  # HTML formatters  # HTML formatters
140    
141  my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');  my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');
# Line 650  if ($import_dircproxy) { Line 668  if ($import_dircproxy) {
668    
669  my $_stat;  my $_stat;
670    
671    POE::Component::Client::HTTP->spawn(
672            Alias   => 'rss-fetch',
673            Timeout => 30,
674    );
675    
676  sub rss_fetch {  sub rss_parse_xml {
677          my ($args) = @_;          my ($args) = @_;
678    
679            warn "## rss_parse_xml ",dump( @_ ) if $debug;
680    
681          # how many messages to send out when feed is seen for the first time?          # how many messages to send out when feed is seen for the first time?
682          my $send_rss_msgs = 1;          my $send_rss_msgs = 1;
683    
684          _log "RSS fetch", $args->{url};          _log "RSS fetch", $args->{url};
685    
686          my $feed = XML::Feed->parse(URI->new( $args->{url} ));          my $feed = XML::Feed->parse( \$args->{xml} );
687          if ( ! $feed ) {          if ( ! $feed ) {
688                  _log("can't fetch RSS ", $args->{url});                  _log "can't fetch RSS ", $args->{url}, XML::Feed->errstr;
689                  return;                  return;
690          }          }
691    
692            $_stat->{rss}->{url2link}->{ $args->{url} } = $feed->link;
693    
694          my ( $total, $updates ) = ( 0, 0 );          my ( $total, $updates ) = ( 0, 0 );
695          for my $entry ($feed->entries) {          for my $entry ($feed->entries) {
696                  $total++;                  $total++;
697    
698                    my $seen_times = $_stat->{rss}->{seen}->{$args->{channel}}->{$feed->link}->{$entry->id}++;
699                  # seen allready?                  # seen allready?
700                  next if $_stat->{rss}->{seen}->{$args->{channel}}->{$feed->link}->{$entry->id}++ > 0;                  warn "## $seen_times ",$entry->id if $debug;
701                    next if $seen_times > 0;
702    
703                  sub prefix {                  sub prefix {
704                          my ($txt,$var) = @_;                          my ($txt,$var) = @_;
# Line 696  sub rss_fetch { Line 724  sub rss_fetch {
724                  $msg .= prefix( ' | ' , $entry->title );                  $msg .= prefix( ' | ' , $entry->title );
725                  $msg .= prefix( ' | ' , $link );                  $msg .= prefix( ' | ' , $link );
726  #               $msg .= prefix( ' id ' , $entry->id );  #               $msg .= prefix( ' id ' , $entry->id );
727                    if ( my $tags = $entry->category ) {
728                            $tags =~ s!^\s+!!;
729                            $tags =~ s!\s*$! !;
730                            $tags =~ s!,?\s+!// !g;
731                            $msg .= prefix( ' ' , $tags );
732                    }
733    
734                  if ( $args->{kernel} && $send_rss_msgs ) {                  if ( $seen_times == 0 && $send_rss_msgs ) {
735                          $send_rss_msgs--;                          $send_rss_msgs--;
736                          if ( ! $args->{private} ) {                          if ( ! $args->{private} ) {
737                                  # FIXME bug! should be save_message                                  # FIXME bug! should be save_message
738  #                               save_message( channel => $args->{channel}, me => 1, nick => $NICK, message => $msg );                                  save_message( channel => $args->{channel}, me => 1, nick => $NICK, message => $msg );
739                                  $sth_insert_log->execute( $args->{channel}, 1, $NICK, $msg, 'now()' );  #                               $sth_insert_log->execute( $args->{channel}, 1, $NICK, $msg, 'now()' );
740                          }                          }
741                          my ( $type, $to ) = ( 'notice', $args->{channel} );                          my ( $type, $to ) = ( 'notice', $args->{channel} );
742                          ( $type, $to ) = ( 'privmsg', $args->{nick} ) if $args->{private};                          ( $type, $to ) = ( 'privmsg', $args->{nick} ) if $args->{private};
743                          _log(">> $type $to", $msg);  
744                          $args->{kernel}->post( $irc => $type => $to, $msg );                          _log("RSS generated $type to $to:", $msg);
745                            # XXX enqueue message to send later
746                            sub enqueue_post {
747                                    my $post = dump( @_ );
748                                    warn "## queue_post $post\n" if $debug;
749                                    $dq->enqueue_string( $post );
750                            }
751                            enqueue_post( $type => $to => $msg );
752    
753                          $updates++;                          $updates++;
754                  }                  }
755          }          }
# Line 730  sub rss_fetch_all { Line 772  sub rss_fetch_all {
772                  where active is true                  where active is true
773          };          };
774          # limit to newer feeds only if we are not sending messages out          # limit to newer feeds only if we are not sending messages out
775          $sql .= qq{     and last_update + delay < now() } if $kernel;          $sql .= qq{     and last_update + delay < now() } if defined ( $_stat->{rss}->{fetch} );
776          my $sth = $dbh->prepare( $sql );          my $sth = $dbh->prepare( $sql );
777          $sth->execute();          $sth->execute();
778          warn "# ",$sth->rows," active RSS feeds\n";          warn "# ",$sth->rows," active RSS feeds\n";
779          my $count = 0;          my $count = 0;
780          while (my $row = $sth->fetchrow_hashref) {          while (my $row = $sth->fetchrow_hashref) {
781                  $row->{kernel} = $kernel if $kernel;                  warn "## queued rss-fetch for ", $row->{url} if $debug;
782                  $count += rss_fetch( $row );                  $_stat->{rss}->{fetch}->{ $row->{url} } = $row;
783                    $kernel->post(
784                            'rss-fetch',
785                            'request',
786                            'rss_response',
787                            HTTP::Request->new( GET => $row->{url} ),
788                    );
789          }          }
790          return "OK, fetched $count posts from " . $sth->rows . " feeds";          return "OK, scheduled " . $sth->rows . " feeds for refresh";
791  }  }
792    
793    
# Line 747  sub rss_check_updates { Line 795  sub rss_check_updates {
795          my $kernel = shift;          my $kernel = shift;
796          $_stat->{rss}->{last_poll} ||= time();          $_stat->{rss}->{last_poll} ||= time();
797          my $dt = time() - $_stat->{rss}->{last_poll};          my $dt = time() - $_stat->{rss}->{last_poll};
         warn "## rss_check_updates $dt > $rss_min_delay\n";  
798          if ( $dt > $rss_min_delay ) {          if ( $dt > $rss_min_delay ) {
799                    warn "## rss_check_updates $dt > $rss_min_delay\n";
800                  $_stat->{rss}->{last_poll} = time();                  $_stat->{rss}->{last_poll} = time();
801                  _log rss_fetch_all( $kernel );                  _log rss_fetch_all( $kernel );
802          }          }
803            # XXX send queue messages
804            while ( my $job = $dq->pickup_queued_job() ) {
805                    my $data = read_file( $job->get_data_path ) || die "can't load ", $job->get_data_path, ": $!";
806    #               $kernel->post( $irc => $type => $to, $msg );
807                    my @data = eval $data;
808                    _log "IRC post from queue:", @data;
809                    $kernel->post( $irc => @data );
810                    $job->finish;
811                    warn "## done queued job: ",dump( @data ) if $debug;
812            }
813  }  }
814    
 # seed rss seen cache so we won't send out all items on startup  
 _log rss_fetch_all;  
   
815  POE::Session->create( inline_states => {  POE::Session->create( inline_states => {
816          _start => sub {                _start => sub {      
817                  $_[KERNEL]->post( $irc => register => 'all' );                  $_[KERNEL]->post( $irc => register => 'all' );
# Line 767  POE::Session->create( inline_states => { Line 822  POE::Session->create( inline_states => {
822                  my $poco_object = $sender->get_heap();                  my $poco_object = $sender->get_heap();
823                  _log "connected to",$poco_object->server_name();                  _log "connected to",$poco_object->server_name();
824                  $kernel->post( $sender => join => $_ ) for @channels;                  $kernel->post( $sender => join => $_ ) for @channels;
825                    # seen RSS cache
826                    _log rss_fetch_all( $kernel );
827                  undef;                  undef;
828          },          },
829      irc_255 => sub {    # server is done blabbing  #       irc_255 => sub {        # server is done blabbing
830                  $_[KERNEL]->post( $irc => join => $CHANNEL);  #               $_[KERNEL]->post( $irc => join => $CHANNEL);
831      },  #       },
832      irc_public => sub {      irc_public => sub {
833                  my $kernel = $_[KERNEL];                  my $kernel = $_[KERNEL];
834                  my $nick = (split /!/, $_[ARG0])[0];                  my $nick = (split /!/, $_[ARG0])[0];
# Line 821  POE::Session->create( inline_states => { Line 878  POE::Session->create( inline_states => {
878                  my $nick = (split /!/, $_[ARG0])[0];                  my $nick = (split /!/, $_[ARG0])[0];
879                  my $msg = $_[ARG2];                  my $msg = $_[ARG2];
880                  my $channel = $_[ARG1]->[0];                  my $channel = $_[ARG1]->[0];
881                    warn "# ARG = ",dump( @_[ARG0,ARG1,ARG2] ) if $debug;
882    
883                  my $res = "unknown command '$msg', try /msg $NICK help!";                  my $res = "unknown command '$msg', try /msg $NICK help!";
884                  my @out;                  my @out;
# Line 949  POE::Session->create( inline_states => { Line 1007  POE::Session->create( inline_states => {
1007                          }                          }
1008                  } elsif ($msg =~ m/^rss-update/) {                  } elsif ($msg =~ m/^rss-update/) {
1009                          $res = rss_fetch_all( $_[KERNEL] );                          $res = rss_fetch_all( $_[KERNEL] );
                 } elsif ($msg =~ m/^rss-clean/) {  
                         $_stat->{rss} = undef;  
                         $dbh->do( qq{ update feeds set last_update = now() - delay } );  
                         $res = "OK, cleaned RSS cache";  
1010                  } elsif ($msg =~ m/^rss-list/) {                  } elsif ($msg =~ m/^rss-list/) {
1011                          my $sth = $dbh->prepare(qq{ select url,name,last_update,active,channel,nick,private from feeds });                          my $sth = $dbh->prepare(qq{ select url,name,last_update,active,channel,nick,private from feeds });
1012                          $sth->execute;                          $sth->execute;
# Line 960  POE::Session->create( inline_states => { Line 1014  POE::Session->create( inline_states => {
1014                                  $_[KERNEL]->post( $irc => privmsg => $nick, join(' | ',@row) );                                  $_[KERNEL]->post( $irc => privmsg => $nick, join(' | ',@row) );
1015                          }                          }
1016                          $res = '';                          $res = '';
1017                  } elsif ($msg =~ m!^rss-(add|remove|stop|start)(?:-(private))?\s+(http://\S+)\s*(.*)!) {                  } elsif ($msg =~ m!^rss-(add|remove|stop|start|clean)(?:-(private))?\s+(http://\S+)\s*(.*)!) {
1018                          my ( $command, $sub, $url, $arg ) = ( $1,$2,$3,$4 );                          my ( $command, $sub, $url, $arg ) = ( $1,$2,$3,$4 );
1019    
1020                          my $channel = $1 if ( $arg =~ s/\s*(#\S+)\s*// );                          my $channel = $1 if ( $arg =~ s/\s*(#\S+)\s*// );
# Line 971  POE::Session->create( inline_states => { Line 1025  POE::Session->create( inline_states => {
1025  #                               remove  => qq{ delete from feeds                                where url = ? and name = ? },  #                               remove  => qq{ delete from feeds                                where url = ? and name = ? },
1026                                  start   => qq{ update feeds set active = true   where url = ? },                                  start   => qq{ update feeds set active = true   where url = ? },
1027                                  stop    => qq{ update feeds set active = false  where url = ? },                                  stop    => qq{ update feeds set active = false  where url = ? },
1028                                    clean   => qq{ update feeds set last_update = now() - delay where url = ? },
1029                          };                          };
1030    
1031                          if ( $command eq 'add' && ! $channel ) {                          if ( $command eq 'add' && ! $channel ) {
# Line 986  POE::Session->create( inline_states => { Line 1041  POE::Session->create( inline_states => {
1041                                  if ($@) {                                  if ($@) {
1042                                          $res = "ERROR: $@";                                          $res = "ERROR: $@";
1043                                  } else {                                  } else {
1044                                          $res = "OK, RSS [$command|$sub|$url|$arg]";                                          $res = "OK, RSS executed $command " . ( $sub ? "-$sub" : '' ) ."on $channel url $url";
1045                                            if ( $command eq 'clean' ) {
1046                                                    my $seen = $_stat->{rss}->{seen} || die "no seen?";
1047                                                    my $want_link = $_stat->{rss}->{url2link}->{$url} || warn "no url2link($url)";
1048                                                    foreach my $c ( keys %$seen ) {
1049                                                            my $c_hash = $seen->{$c} || die "no seen->{$c}";
1050                                                            die "not HASH with rss links but ", dump($c_hash) unless ref($c_hash) eq 'HASH';
1051                                                            foreach my $link ( keys %$c_hash ) {
1052                                                                    next unless $link eq $want_link;
1053                                                                    _log "RSS removed seen $c $url $link";
1054                                                            }
1055                                                    }
1056                                            }
1057                                  }                                  }
1058                          } else {                          } else {
1059                                  $res = "ERROR: don't know what to do with: $msg";                                  $res = "ERROR: don't know what to do with: $msg";
1060                          }                          }
1061                    } elsif ($msg =~ m/^rss-clean/) {
1062                            # this makes sense because we didn't catch rss-clean http://... before!
1063                            $_stat->{rss} = undef;
1064                            $dbh->do( qq{ update feeds set last_update = now() - delay } );
1065                            $res = "OK, cleaned RSS cache";
1066                  }                  }
1067    
1068                  if ($res) {                  if ($res) {
# Line 1009  POE::Session->create( inline_states => { Line 1081  POE::Session->create( inline_states => {
1081          irc_376 => sub {          irc_376 => sub {
1082                  _log "<< motd", $_[ARG0], "end";                  _log "<< motd", $_[ARG0], "end";
1083          },          },
1084    #       irc_433 => sub {
1085    #               print "# irc_433: ",$_[ARG1], "\n";
1086    #               warn "## indetify $NICK\n";
1087    #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );
1088    #       },
1089    #       irc_451 # please register
1090          irc_477 => sub {          irc_477 => sub {
1091                  _log "<< irc_477: ",$_[ARG1];                  _log "<< irc_477: ",$_[ARG1];
1092                  $_[KERNEL]->post( $irc => privmsg => 'nickserv', "register $NICK" );                  _log ">> IDENTIFY $NICK";
1093                    $_[KERNEL]->post( $irc => privmsg => 'NickServ', "IDENTIFY $NICK" );
1094          },          },
1095          irc_505 => sub {          irc_505 => sub {
1096                  _log "<< irc_505: ",$_[ARG1];                  _log "<< irc_505: ",$_[ARG1];
1097                  $_[KERNEL]->post( $irc => privmsg => 'nickserv', "register $NICK" );                  _log ">> register $NICK";
1098                    $_[KERNEL]->post( $irc => privmsg => 'NickServ', "register $NICK" );
1099    #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );
1100  #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "set hide email on" );  #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "set hide email on" );
1101  #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "set email dpavlin\@rot13.org" );  #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "set email dpavlin\@rot13.org" );
1102          },          },
# Line 1032  POE::Session->create( inline_states => { Line 1113  POE::Session->create( inline_states => {
1113                  sleep($sleep_on_error);                  sleep($sleep_on_error);
1114                  $_[KERNEL]->post( $irc => connect => {} );                  $_[KERNEL]->post( $irc => connect => {} );
1115          },          },
 #       irc_433 => sub {  
 #               print "# irc_433: ",$_[ARG1], "\n";  
 #               warn "## indetify $NICK\n";  
 #               $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );  
 #       },  
 #       irc_451 # please register  
1116          irc_notice => sub {          irc_notice => sub {
1117                  _log "<< notice",$_[ARG0];                  _log "<< notice from ", $_[ARG0], $_[ARG1], $_[ARG2];
1118                  if ( $_[ARG0] =~ m!/msg\s+NickServ\s+IDENTIFY!i ) {                  my $m = $_[ARG2];
1119                    if ( $m =~ m!/msg.*(NickServ).*(IDENTIFY)!i ) {
1120                            _log ">> suggested to $1 $2";
1121                            $_[KERNEL]->post( $irc => privmsg => $1, "$2 $NICK" );
1122                    } elsif ( $m =~ m!\Q$NICK\E.*registered!i ) {
1123                            _log ">> registreted, so IDENTIFY";
1124                          $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );                          $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" );
1125                    } else {
1126                            warn "## ignore $m\n" if $debug;
1127                  }                  }
1128          },          },
1129          irc_snotice => sub {          irc_snotice => sub {
1130                  _log "<< snotice",$_[ARG0];                  _log "<< snotice", $_[ARG0]; #dump( $_[ARG0],$_[ARG1], $_[ARG2] );
1131                  if ( $_[ARG0] =~ m!/(QUOTE)\s+(PASS\s+\d+)!i ) {                  if ( $_[ARG0] =~ m!/(QUOTE)\s+(PASS\s+\d+)!i ) {
1132                          warn ">> $1 | $2\n";                          warn ">> $1 | $2\n";
1133                          $_[KERNEL]->post( $irc => lc($1) => $2);                          $_[KERNEL]->post( $irc => lc($1) => $2);
# Line 1060  POE::Session->create( inline_states => { Line 1142  POE::Session->create( inline_states => {
1142                          "";                          "";
1143        0;                        # false for signals        0;                        # false for signals
1144      },      },
1145            rss_response => sub {
1146                    my ($request_packet, $response_packet) = @_[ARG0, ARG1];
1147                    my $request_object  = $request_packet->[0];
1148                    my $response_object = $response_packet->[0];
1149    
1150                    my $row = delete( $_stat->{rss}->{fetch}->{ $request_object->uri } );
1151                    if ( $row ) {
1152                            $row->{xml} = $response_object->content;
1153                            rss_parse_xml( $row );
1154                    } else {
1155                            warn "## can't find rss->fetch for ", $request_object->uri;
1156                    }
1157            },
1158     },     },
1159    );    );
1160    
1161  # http server  # http server
1162    
1163    _log "WEB archive at $url";
1164    
1165  my $httpd = POE::Component::Server::HTTP->new(  my $httpd = POE::Component::Server::HTTP->new(
1166          Port => $http_port,          Port => $http_port,
1167          PreHandler => {          PreHandler => {
# Line 1111  foreach my $c (@cols) { Line 1208  foreach my $c (@cols) {
1208          $style .= ".col-${max_color} { background: $c }\n";          $style .= ".col-${max_color} { background: $c }\n";
1209          $max_color++;          $max_color++;
1210  }  }
1211  warn "defined $max_color colors for users...\n";  _log "WEB defined $max_color colors for users...";
1212    
1213  sub root_handler {  sub root_handler {
1214          my ($request, $response) = @_;          my ($request, $response) = @_;
# Line 1233  sub root_handler { Line 1330  sub root_handler {
1330                          $feed->add_entry( $feed_entry );                          $feed->add_entry( $feed_entry );
1331    
1332                  } else {                  } else {
1333                          _log "unknown rss request $r_url";                          _log "WEB unknown rss request $r_url";
1334                          $feed->title( "unknown $r_url" );                          $feed->title( "unknown $r_url" );
1335                          foreach my $c ( @commands ) {                          foreach my $c ( @commands ) {
1336                                  my $feed_entry = XML::Feed::Entry->new($type);                                  my $feed_entry = XML::Feed::Entry->new($type);
# Line 1336  sub root_handler { Line 1433  sub root_handler {
1433          <p>See <a href="/history">history</a> of all messages.</p>          <p>See <a href="/history">history</a> of all messages.</p>
1434          </body></html>};          </body></html>};
1435    
1436          $response->content( $html );          $response->content( decode('utf-8',$html) );
1437          warn "<< ", $request->method, " ", $request->uri, " created ", length($html), " bytes\n";          warn "<< ", $request->method, " ", $request->uri, " created ", length($html), " bytes\n";
1438          return RC_OK;          return RC_OK;
1439  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26