Add edition
This commit is contained in:
parent
da7a19f62b
commit
678a973c19
|
@ -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`.
|
||||
|
||||
|
|
|
@ -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))))
|
Loading…
Reference in New Issue