Skip to content

Instantly share code, notes, and snippets.

@octatone
Created October 26, 2014 09:41
Show Gist options
  • Save octatone/343b7116bd6d89d9d449 to your computer and use it in GitHub Desktop.
Save octatone/343b7116bd6d89d9d449 to your computer and use it in GitHub Desktop.
Getting an access token from Twitter
(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