Created
September 25, 2020 17:18
-
-
Save duanebester/684a3338533cadbb46d155a9577c3b6d to your computer and use it in GitHub Desktop.
GitHub Repos Loop
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
;; Create global atom list to hold all repositories | |
(def repos (atom ())) | |
;; Loop through repositories | |
(loop [page 1] | |
(let [resp (get-repos page 100) has_next (get resp :has_next)] | |
(swap! repos concat (get resp :body)) ; Add to global repos list | |
(if has_next | |
(recur (inc page)) | |
page))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment