507 |
} |
} |
508 |
|
|
509 |
if ( @tags ) { |
if ( @tags ) { |
510 |
shift @last_tags if $#last_tags == $last_x_tags; |
pop @last_tags if $#last_tags == $last_x_tags; |
511 |
push @last_tags, { tags => [ @tags ], %$arg }; |
unshift @last_tags, { tags => [ @tags ], %$arg }; |
512 |
} |
} |
513 |
|
|
514 |
} |
} |
520 |
=cut |
=cut |
521 |
|
|
522 |
sub seed_tags { |
sub seed_tags { |
523 |
my $sth = $dbh->prepare(qq{ select id,message,nick,me,time from log where message like '%//%' }); |
my $sth = $dbh->prepare(qq{ select id,message,nick,me,time from log where message like '%//%' order by time asc }); |
524 |
$sth->execute; |
$sth->execute; |
525 |
while (my $row = $sth->fetchrow_hashref) { |
while (my $row = $sth->fetchrow_hashref) { |
526 |
add_tag( %$row ); |
add_tag( %$row ); |
979 |
$response->content_type( 'application/' . lc($type) . '+xml' ); |
$response->content_type( 'application/' . lc($type) . '+xml' ); |
980 |
|
|
981 |
my $html = '<!-- error -->'; |
my $html = '<!-- error -->'; |
982 |
warn "create $type feed from ",dump( @last_tags ); |
#warn "create $type feed from ",dump( @last_tags ); |
983 |
|
|
984 |
my $feed = XML::Feed->new( $type ); |
my $feed = XML::Feed->new( $type ); |
985 |
|
|
986 |
$feed->title( "last $last_x_tags from $CHANNEL" ); |
$feed->title( "last $last_x_tags from $CHANNEL" ); |
987 |
# $feed->link( "http://$http_hostname:$http_port" ); |
$feed->link( $url ); |
988 |
$feed->description( "collects messages which have tags// in them" ); |
$feed->description( "collects messages which have tags// in them" ); |
989 |
|
|
990 |
foreach my $m ( @last_tags ) { |
foreach my $m ( @last_tags ) { |
1097 |
</body></html>}; |
</body></html>}; |
1098 |
|
|
1099 |
$response->content( $html ); |
$response->content( $html ); |
1100 |
warn "<< ", $request->method, $request->uri, " created ", length($html), " bytes\n"; |
warn "<< ", $request->method, " ", $request->uri, " created ", length($html), " bytes\n"; |
1101 |
return RC_OK; |
return RC_OK; |
1102 |
} |
} |
1103 |
|
|