diff --git a/README.md b/README.md index e94e56c..7befef7 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,9 @@ Feel free to open issues and PRs. Current TODOs are: -* Test extensively parsing of RSS feeds. * Work on a comfortable and polished CLI endpoint * Add enpoints in general (new visualization, curses, improve HTML...) -* Documentation and usage examples +* Implement an efficient categorization of feeds (by topic maybe?) +* Oneshot mode (no daemon, cron support), might be connected to local archive + for article (DB/text)? +* Documentation and usage examples. diff --git a/source/cartastraccia/rss.d b/source/cartastraccia/rss.d index 1b19ba3..0ff5c58 100644 --- a/source/cartastraccia/rss.d +++ b/source/cartastraccia/rss.d @@ -180,9 +180,14 @@ return; }, (ref ValidRSS vr) { + + if(vr.channel.items[0].pubDate == "") { + logInfo("["~vr.channel.title~"] No pubDate for feed items. Not sorting articles by date"); + return; + } vr.channel.items.sort!( (i,j) { return (parseRFC822DateTime(i.pubDate) - > parseRFC822DateTime(j.pubDate)); + > parseRFC822DateTime(j.pubDate)); }); }); } diff --git a/source/main.d b/source/main.d index afbee86..fbb621b 100644 --- a/source/main.d +++ b/source/main.d @@ -81,7 +81,11 @@ { // parse feed list auto pt = ConfigFile(readText(feedsFile)); - enforce(pt.successful, "Invalid "~feedsFile~" file format, check cartastraccia.config for grammar"); + if(!pt.successful) { + logWarn("Invalid "~feedsFile~" file format, check cartastraccia.config for grammar"); + return; + } + auto feeds = processFeeds(pt); TaskMap tasks;