Add edition

This commit is contained in:
Andros Fenollosa 2021-07-07 01:07:59 +02:00
parent da7a19f62b
commit 678a973c19
2 changed files with 9 additions and 9 deletions

View File

@ -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`.

View File

@ -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))))