Add edition
This commit is contained in:
parent
da7a19f62b
commit
678a973c19
|
@ -45,13 +45,13 @@ feeds:
|
||||||
https://github.com/tanrax/RSSpaper/releases
|
https://github.com/tanrax/RSSpaper/releases
|
||||||
|
|
||||||
|
|
||||||
4) Now you can execute glosa.
|
4) Now you can execute.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
java -jar rsspaper-{version}-standalone.jar
|
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`.
|
That's it, now you just have to open `dist/index.html`.
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
(defn filter-edition
|
(defn filter-edition
|
||||||
[articles]
|
[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)
|
(case (:edition config)
|
||||||
"daily" articles
|
"daily" (filter (fn [article] (> (:published-date article) daily)) articles)
|
||||||
"weekly" articles
|
"weekly" (filter (fn [article] (> (:published-date article) weekly)) articles)
|
||||||
:else articles
|
:else articles)))
|
||||||
)))
|
|
||||||
|
|
||||||
|
|
||||||
(defn add-datetimes-formatter
|
(defn add-datetimes-formatter
|
||||||
|
@ -58,8 +58,8 @@
|
||||||
(conj feeds
|
(conj feeds
|
||||||
(parse-url feed-url {:insecure? true :throw-exceptions false}))
|
(parse-url feed-url {:insecure? true :throw-exceptions false}))
|
||||||
) [] (:feeds config))
|
) [] (:feeds config))
|
||||||
filter-edition
|
|
||||||
zip-feeds-in-articles
|
zip-feeds-in-articles
|
||||||
add-cover-article
|
|
||||||
datetimes-to-unixtime
|
datetimes-to-unixtime
|
||||||
|
filter-edition
|
||||||
|
add-cover-article
|
||||||
add-datetimes-formatter))))
|
add-datetimes-formatter))))
|
Loading…
Reference in New Issue