Skip to content

Instantly share code, notes, and snippets.

@duanebester
Created September 25, 2020 17:18
Show Gist options
  • Save duanebester/684a3338533cadbb46d155a9577c3b6d to your computer and use it in GitHub Desktop.
Save duanebester/684a3338533cadbb46d155a9577c3b6d to your computer and use it in GitHub Desktop.
GitHub Repos Loop
;; 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