From 678a973c199875394f648ef0f51cb3b9f73b53c8 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Wed, 7 Jul 2021 01:07:59 +0200 Subject: [PATCH] Add edition --- README.md | 4 ++-- src/rsspaper/feeds.clj | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a374edf..8fbd42c 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ feeds: https://github.com/tanrax/RSSpaper/releases -4) Now you can execute glosa. +4) Now you can execute. ```sh java -jar rsspaper-{version}-standalone.jar ``` -Great 🎉. You already have your 🔥 own Static RSS Newspaper 🔥. +Great 🎉. You already have your 📰 own Static RSS Newspaper 📰. That's it, now you just have to open `dist/index.html`. diff --git a/src/rsspaper/feeds.clj b/src/rsspaper/feeds.clj index fb942c1..279d80d 100644 --- a/src/rsspaper/feeds.clj +++ b/src/rsspaper/feeds.clj @@ -17,12 +17,12 @@ (defn filter-edition [articles] - (let [daily (- (c/to-long (t/now)) 86400), weekly (- (c/to-long (t/now)) 604800)] + (let [daily (- (c/to-long (t/now)) 86400) + weekly (- (c/to-long (t/now)) 604800)] (case (:edition config) - "daily" articles - "weekly" articles - :else articles - ))) + "daily" (filter (fn [article] (> (:published-date article) daily)) articles) + "weekly" (filter (fn [article] (> (:published-date article) weekly)) articles) + :else articles))) (defn add-datetimes-formatter @@ -58,8 +58,8 @@ (conj feeds (parse-url feed-url {:insecure? true :throw-exceptions false})) ) [] (:feeds config)) - filter-edition zip-feeds-in-articles - add-cover-article datetimes-to-unixtime + filter-edition + add-cover-article add-datetimes-formatter)))) \ No newline at end of file