255 |
|
|
256 |
eval { $sth->execute( $value, $nick, $channel, $name ) }; |
eval { $sth->execute( $value, $nick, $channel, $name ) }; |
257 |
|
|
258 |
# error or no result |
if ( $@ ) { |
259 |
if ( $@ || ! $sth->rows ) { |
# error |
260 |
|
_log("META ERROR: $@"); |
261 |
|
} elsif ( ! $sth->rows ) { |
262 |
|
# no result -> add new |
263 |
$sth = $dbh->prepare(qq{ insert into meta (value,nick,channel,name,changed) values (?,?,?,?,now()) }); |
$sth = $dbh->prepare(qq{ insert into meta (value,nick,channel,name,changed) values (?,?,?,?,now()) }); |
264 |
$sth->execute( $value, $nick, $channel, $name ); |
eval { $sth->execute( $value, $nick, $channel, $name ); }; |
265 |
warn "## created $nick/$channel/$name = $value\n"; |
if ( $@ ) { |
266 |
|
_log "META ERROR: $@"; |
267 |
|
} else { |
268 |
|
_log "META: created $nick/$channel/$name = $value\n"; |
269 |
|
} |
270 |
} else { |
} else { |
271 |
warn "## updated $nick/$channel/$name = $value\n"; |
_log "META: updated $nick/$channel/$name = $value\n"; |
272 |
} |
} |
273 |
|
|
274 |
return $value; |
return $value; |
563 |
" " . $a->{message}; |
" " . $a->{message}; |
564 |
|
|
565 |
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}); }; |
566 |
_log "ERROR: can't archive ", $a->{message} if $@; |
if ( $@ ) { |
567 |
$cloud->add_tag( id => $dbh->last_insert_id(undef,undef,"log",undef), %$a ); |
_log "ERROR: can't archive ", $a->{message}; |
568 |
|
} else { |
569 |
|
$cloud->add_tag( id => $dbh->last_insert_id(undef,undef,"log",undef), %$a ); |
570 |
|
} |
571 |
} |
} |
572 |
|
|
573 |
|
|
636 |
|
|
637 |
warn "## RSS fetch first $send_rss_msgs items from", $args->{url} if $debug; |
warn "## RSS fetch first $send_rss_msgs items from", $args->{url} if $debug; |
638 |
|
|
639 |
my $feed = XML::Feed->parse( \$args->{xml} ); |
my $feed; |
640 |
|
eval { $feed = XML::Feed->parse( \$args->{xml} ) }; |
641 |
if ( ! $feed ) { |
if ( ! $feed ) { |
642 |
_log "can't fetch RSS ", $args->{url}, XML::Feed->errstr; |
_log "can't fetch RSS ", $args->{url}, XML::Feed->errstr; |
643 |
return; |
return; |
1294 |
$rc = RC_DENY; |
$rc = RC_DENY; |
1295 |
} |
} |
1296 |
|
|
1297 |
$response->content( $feed->as_xml ); |
eval { $response->content( $feed->as_xml ); }; |
1298 |
|
$rc = RC_INTERNAL_SERVER_ERROR if $@; |
1299 |
return $rc; |
return $rc; |
1300 |
} |
} |
1301 |
|
|