Created
August 7, 2013 16:55
-
-
Save aamedina/6175950 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn page! | |
[init-res req] | |
(go | |
(loop [coll (into (sorted-set-by #(compare (:id %1) (:id %2))) init-res)] | |
(let [req (update-in | |
req [:query-params] | |
merge | |
{:max_id (:id_str (first coll))}) | |
res (<! (async-request req)) | |
new-coll (into coll res)] | |
(if (= (count new-coll) (count coll)) | |
coll | |
(recur new-coll)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment