Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/orrg.git
Log | Files | Refs | README | LICENSE

commit a09b98b4d50d664bce1dd9f206d4802754dd7abe
parent 7eaf663655cd395a0c3b925142b7f07901a3cca4
Author: René Wagner <rwagner@rw-net.de>
Date:   Thu, 26 Nov 2020 12:13:07 +0100

use UTC timestamps everywhere to avoid misinterpretion

update README

MREADME.md | 14++++++++++----
Morrg.pl | 7++++++-
2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -1,17 +1,23 @@ # orrg (online rss feed reader for gemini) *orrg* is a cgi script for [gemini](gemini://gemini.circumlunar.space) servers. -It fetches an arbitrary rss/atom feed given by the user and renders its content as a gemini site. +It delivers an easy way to consume atom or rss feeds shipped over http(s) within gemini. -Visit the [demo](gemini://gmndemo.clttr.info/orrg.pl?https:%2F%2Fgit.sr.ht%2F~rwa%2Forrg%2Flog%2Frss.xml) ([through http proxy](ihttps://portal.mozz.us/gemini/gmndemo.clttr.info/orrg.pl%3Fhttps:%252F%252Fgit.sr.ht%252F~rwa%252Forrg%252Flog%252Frss.xml)) that shows the commit log of this repo. +Visit the [demo](gemini://gmndemo.clttr.info/orrg.pl?https:%2F%2Fgit.sr.ht%2F~rwa%2Forrg%2Flog%2Frss.xml) ([through http proxy](https://portal.mozz.us/gemini/gmndemo.clttr.info/orrg.pl%3Fhttps:%252F%252Fgit.sr.ht%252F~rwa%252Forrg%252Flog%252Frss.xml)) that shows the commit log of this repo. +The demo might break regularly as i use it for integration testing during development. ## features -- load an atom/rss feed given by user input -- render feed (channel & item info) as a gemini site +- load an atom/rss feed from http(s) given by user input +- render feed (channel info & entrys) as a gemini site + - include links to originating site and every article Fetching feeds from gemini is currently not supported -> https://todo.sr.ht/~rwa/gmni-perl/4 +## non-features + +*orrg* is more of a PoC and will never be a full-fletched feed aggregator with archiving and searching capabilities. + # installation - setup your geminiserver with cgi enabled diff --git a/orrg.pl b/orrg.pl @@ -7,6 +7,8 @@ use strict; no warnings 'experimental'; use URI::Escape; use XML::FeedPP; +use DateTime; +use DateTime::Format::ISO8601; use POSIX qw(strftime); use v5.10; # enable UTF-8 mode for everything @@ -71,7 +73,10 @@ sub create_response foreach my $it ($feed->get_item()) { push @body, '### '. $it->title; - $it->pubDate eq '' or push @body, 'published '. $it->pubDate; + if ($it->pubDate ne '') { + my $dt = DateTime::Format::ISO8601->parse_datetime($it->pubDate); + push @body, 'published '. strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($dt->epoch)); + } push @body, ''; $it->description eq '' or push @body, $it->description; $it->link eq '' or push @body, ('=> '.$it->link.' open entry in browser', '');