Created
January 16, 2009 17:21
-
-
Save drewr/48017 to your computer and use it in GitHub Desktop.
This file contains 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
(ns org.buntin.github.github) | |
(defn- perform-request [url] | |
; HTTP stuff... | |
url) | |
(defn make-github [version return-type] | |
(fn [url & args] | |
(perform-request | |
(apply format | |
(str "http://github.com/api/%s/%s" url) version return-type args)))) | |
(defn user [username] | |
(format "/%s" username)) | |
(defn recent [username project branch] | |
(format "/%s/%s/commits/%s" username project branch)) | |
(defn search [query] | |
(format "/search/%s" query)) | |
(defn commit [username project sha] | |
(format "/%s/%s/commit/%s" username project sha)) | |
(comment | |
(def github (make-github "v1" "json")) | |
(github (user "sethtrain")) | |
(github (recent "sethtrain" "authorize-clj" "master")) | |
(github (search "clojure")) | |
(github (commit "sethtrain" "authorize-clj" "a2771c6db5cc6c034c617374c239d0ae6c351d6f")) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment