Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hiredman committed Nov 21, 2010
1 parent 70ce599 commit 5b95500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions problems.org
Expand Up @@ -19,3 +19,5 @@
plugin namespaces from that.
- actually, maybe first try at a new plugin will be a hudson BUILD
IT NOW plugin
- build it now plugin for hudson done

7 changes: 4 additions & 3 deletions src/clojurebot/feed.clj
Expand Up @@ -17,7 +17,6 @@
(xml/parse)
(tree-seq map? (comp seq :content))))


(defn find-tag [tag top]
(->> top :content (filter #(= tag (:tag %))) first))

Expand Down Expand Up @@ -51,6 +50,8 @@
(filter #(= :entry (:tag %)))
(map entry->map)))

(def last-seen 500)

(defonce ^{:private true} entry-cache (atom {}))

(defn atom-pull*
Expand All @@ -65,7 +66,7 @@
seen-ids)
new-entries (reverse (filter (comp new-ids :id) latest-entries))]
(swap! entry-cache
update-in [key] (comp set #(take 100 %) #(into % new-ids) set))
update-in [key] (comp set #(take last-seen %) #(into % new-ids) set))
(if ids
(first new-entries)
new-entries))))
Expand All @@ -85,7 +86,7 @@
seen-ids)
new-entries (reverse (filter (comp new-ids :id) latest-entries))]
(swap! entry-cache
update-in [url] (comp set #(take 100 %) #(into % new-ids) set))
update-in [url] (comp set #(take last-seen %) #(into % new-ids) set))
(if ids
(first new-entries)
(reduce #(str %1 %2 "\n") nil (take 5 new-entries)))))

0 comments on commit 5b95500

Please sign in to comment.