970 |
|
|
971 |
my $search = $q->param('search') || $q->param('grep') || ''; |
my $search = $q->param('search') || $q->param('grep') || ''; |
972 |
|
|
973 |
if ($request->url =~ m#/(rss|atom)#) { |
if ($request->url =~ m#/rss#i) { |
974 |
my $type = uc($1); |
my $type = 'RSS'; # Atom |
|
my $url = "http://$http_hostname:$http_port"; |
|
975 |
|
|
976 |
$response->content_type("application/$type+xml"); |
$response->content_type( 'application/' . lc($type) . '+xml' ); |
977 |
|
|
978 |
my $html = '<!-- error -->'; |
my $html = '<!-- error -->'; |
979 |
warn "create $type feed from ",dump( @last_tags ); |
warn "create $type feed from ",dump( @last_tags ); |
981 |
my $feed = XML::Feed->new( $type ); |
my $feed = XML::Feed->new( $type ); |
982 |
|
|
983 |
$feed->title( "last $last_x_tags from $CHANNEL" ); |
$feed->title( "last $last_x_tags from $CHANNEL" ); |
984 |
$feed->link( "http://$http_hostname:$http_port" ); |
# $feed->link( "http://$http_hostname:$http_port" ); |
985 |
$feed->description( "collects messages which have tags// in them" ); |
$feed->description( "collects messages which have tags// in them" ); |
986 |
|
|
987 |
foreach my $m ( @last_tags ) { |
foreach my $m ( @last_tags ) { |
993 |
# $feed_entry->link( ); |
# $feed_entry->link( ); |
994 |
$feed_entry->issued( DateTime::Format::Flexible->build( $m->{time} ) ); |
$feed_entry->issued( DateTime::Format::Flexible->build( $m->{time} ) ); |
995 |
$feed_entry->summary( |
$feed_entry->summary( |
996 |
|
'<![CDATA[' . |
997 |
# $filter->{nick}->( $m->{nick} ) . |
# $filter->{nick}->( $m->{nick} ) . |
998 |
# '<tt>' . $m->{nick} . '</tt> ' . |
# '<tt>' . $m->{nick} . '</tt> ' . |
999 |
$filter->{message}->( $m->{message} ) |
$filter->{message}->( $m->{message} ) . |
1000 |
|
']]>' |
1001 |
); |
); |
1002 |
|
$feed_entry->category( join(', ', @{$m->{tags}}) ); |
1003 |
$feed->add_entry( $feed_entry ); |
$feed->add_entry( $feed_entry ); |
1004 |
} |
} |
1005 |
|
|