Created
October 26, 2014 09:41
-
-
Save octatone/343b7116bd6d89d9d449 to your computer and use it in GitHub Desktop.
Getting an access token from Twitter
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
(defn get-token [] | |
(let [options { | |
:basic-auth [app-consumer-key app-consumer-secret] | |
:form-params {:grant_type "client_credentials"}} | |
result (client/post token-url options) | |
body-json (json/read-str (:body result) :key-fn keyword)] | |
(:access_token body-json))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment