Filter Ask HN

This commit is contained in:
Andros Fenollosa 2022-01-02 10:06:34 +01:00
parent da6f779f91
commit 529fa33de5
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
(defproject isahn "1.0.1" (defproject isahn "1.0.2"
:description "ISAHN check news stories for Hacker News" :description "ISAHN check news stories for Hacker News"
:url "http://example.com/FIXME" :url "http://example.com/FIXME"
:micense {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" :micense {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"

View File

@ -60,10 +60,13 @@
;; Filter created less 24h ;; Filter created less 24h
(let [stories_24h (filter #(> (get-in % ["time"]) min_time) stories) (let [stories_24h (filter #(> (get-in % ["time"]) min_time) stories)
;; Filter history ;; Filter history
stories_without_histories (filter #(not (lazy_contains? history_ids (get-in % ["id"]))) stories_24h)] stories_without_histories (filter #(not (lazy_contains? history_ids (get-in % ["id"]))) stories_24h)
;; Filter "Ask HN:"
stories_without_ask_HN (filter #(not (lazy_contains? "Ask HN:" (get-in % ["title"]))) stories_without_histories)
;; Filter with score min_score ;; Filter with score min_score
(filter #(> (get-in % ["score"]) min_score) stories_without_histories))) stories_less_24h (filter #(> (get-in % ["score"]) min_score) stories_without_ask_HN)]
;; Return
stories_less_24h))
(defn filter_with_url (defn filter_with_url
"Filter by removing stories that do not have the URL property" "Filter by removing stories that do not have the URL property"