online rss & atom feed reader for gemini
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
903 B

#!/usr/bin/perl
# Copyright René Wagner 2020
# licenced under BSD 3-Clause licence
# https://src.clttr.info/rwa/orrgg
use strict;
no warnings 'experimental';
use URI::Escape;
use lib 'lib/';
use orrg;
# enable UTF-8 mode for everything
use utf8;
binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';
if (!defined($ENV{'SERVER_PROTOCOL'}) || $ENV{'SERVER_PROTOCOL'} ne 'GEMINI')
{
write_response('CGI_ERROR', '', undef);
}
write_response('SUCCESS', 'text/gemini', create_response());
exit;
sub create_response
{
my @body = ();
push @body, ('# recently visited feeds', '');
my $recents = recent_get();
if ( defined($recents) ) {
foreach (@$recents) {
my ($uri, $name) = split / /, $_, 2;
push @body, '=> ./orrg.pl?'. uri_escape($uri) .' '. ($name eq '' ? $uri : $name);
}
} else {
push @body, 'No feeds found';
}
push @body, ('', '', '=> ./index.pl [home]');
return @body;
}