18 |
use XML::Feed; |
use XML::Feed; |
19 |
use DateTime::Format::Flexible; |
use DateTime::Format::Flexible; |
20 |
use Encode; |
use Encode; |
21 |
|
#use Redis 2.0; |
22 |
|
|
23 |
=head1 NAME |
=head1 NAME |
24 |
|
|
565 |
" " . $a->{message}; |
" " . $a->{message}; |
566 |
|
|
567 |
eval { $sth_insert_log->execute($a->{channel}, $a->{me}, $a->{nick}, $a->{message}, $a->{time}); }; |
eval { $sth_insert_log->execute($a->{channel}, $a->{me}, $a->{nick}, $a->{message}, $a->{time}); }; |
568 |
|
|
569 |
|
eval { |
570 |
|
my @channel = ( 'channel' , $a->{channel}, $a->{nick} ); |
571 |
|
push @channel, 'me' if $a->{me}; |
572 |
|
# my $redis = Redis->new( server => '192.168.1.61:6379' ); |
573 |
|
# $redis->publish( join(' ',@channel), $a->{message} ); |
574 |
|
}; |
575 |
|
|
576 |
if ( $@ ) { |
if ( $@ ) { |
577 |
_log "ERROR: can't archive ", $a->{message}; |
_log "ERROR: can't archive ", $a->{message}; |
578 |
} else { |
} else { |
582 |
|
|
583 |
|
|
584 |
if ($import_dircproxy) { |
if ($import_dircproxy) { |
585 |
|
my ( $from_time, $date_time ) = $dbh->selectrow_array(qq{ |
586 |
|
select date_part('epoch',max(time)),max(time) from log |
587 |
|
}); |
588 |
|
|
589 |
|
warn "IMPORT $date_time [$from_time]\n"; |
590 |
|
|
591 |
open(my $l, $import_dircproxy) || die "can't open $import_dircproxy: $!"; |
open(my $l, $import_dircproxy) || die "can't open $import_dircproxy: $!"; |
592 |
warn "importing $import_dircproxy...\n"; |
warn "importing $import_dircproxy...\n"; |
593 |
my $tz_offset = 1 * 60 * 60; # TZ GMT+2 |
my $tz_offset = 1 * 60 * 60; # TZ GMT+2 |
596 |
if (/^@(\d+)\s(\S+)\s(.+)$/) { |
if (/^@(\d+)\s(\S+)\s(.+)$/) { |
597 |
my ($time, $nick, $msg) = ($1,$2,$3); |
my ($time, $nick, $msg) = ($1,$2,$3); |
598 |
|
|
599 |
|
next if $time <= $from_time; |
600 |
|
|
601 |
my $dt = DateTime->from_epoch( epoch => $time + $tz_offset ); |
my $dt = DateTime->from_epoch( epoch => $time + $tz_offset ); |
602 |
|
|
603 |
my $me = 0; |
my $me = 0; |
1190 |
|
|
1191 |
return RC_OK if $request->uri =~ m/favicon.ico$/; |
return RC_OK if $request->uri =~ m/favicon.ico$/; |
1192 |
|
|
1193 |
|
if ( $request->uri =~ m/robots.txt$/ ) { |
1194 |
|
$response->content_type( 'text/plain' ); |
1195 |
|
$response->content( qq{ |
1196 |
|
|
1197 |
|
User-Agent: * |
1198 |
|
Disallow: / |
1199 |
|
|
1200 |
|
}); |
1201 |
|
return RC_OK; |
1202 |
|
} |
1203 |
|
|
1204 |
my $q; |
my $q; |
1205 |
|
|
1206 |
if ( $request->method eq 'POST' ) { |
if ( $request->method eq 'POST' ) { |
1337 |
my $html = |
my $html = |
1338 |
qq{<html><head><title>$NICK</title><style type="text/css">$style} |
qq{<html><head><title>$NICK</title><style type="text/css">$style} |
1339 |
. $cloud->css |
. $cloud->css |
1340 |
. qq{</style></head><body>} |
. qq{</style> |
1341 |
|
<meta name="google-site-verification" content="oe-LvUiNiQRPpc_uB-3rY4MWvFifkmLf276WzAvTL5U" /> |
1342 |
|
</head><body>} |
1343 |
. qq{ |
. qq{ |
1344 |
<form method="post" class="search" action="/"> |
<form method="post" class="search" action="/"> |
1345 |
<input type="text" name="search" value="$search" size="10"> |
<input type="text" name="search" value="$search" size="10"> |