Created
September 8, 2016 06:02
-
-
Save briansunter/bbca06257b2398073192156c8a00850f to your computer and use it in GitHub Desktop.
Infinite reddit post channel
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 get-posts | |
[ch] | |
(go-loop [a nil] | |
(let [res (get-posts-page a) | |
posts (res :children) | |
after (res :after)] | |
(do | |
(doseq [p posts] | |
(>! ch p)) | |
(recur after))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment