Last active
September 25, 2020 16:37
-
-
Save duanebester/2188fc7334c590b6d9bb210a5e5a9171 to your computer and use it in GitHub Desktop.
GitHub Repos Headers
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
(def link (get-in @(http/get repo-url base-options) [:headers :link])) | |
;; link is a comma-delimited array of relative pages | |
(println link) | |
; => <https://github.com/api/v3/organizations/<id>/repos?page=2>; rel="next", <https://github.com/api/v3/organizations/<id>/repos?page=9>; rel="last" | |
;; Do we have a next page? | |
(def have_next (str/includes? link "rel=\"next\"")) | |
(println have_next) | |
; => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment