Skip to content

Commit

Permalink
added use of access token secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Revelle committed Sep 4, 2009
1 parent 3cbcaf9 commit 7e6d0dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/twitter.clj
Expand Up @@ -15,6 +15,7 @@

(def *oauth-consumer* nil)
(def *oauth-access-token* nil)
(def *oauth-access-token-secret* nil)
(def *protocol* "http")

;; Get JSON from clj-apache-http
Expand All @@ -23,9 +24,10 @@

(defmacro with-oauth
"Set the OAuth access token to be used for all contained Twitter requests."
[consumer access-token & body]
[consumer access-token access-token-secret & body]
`(binding [*oauth-consumer* ~consumer
*oauth-access-token* ~access-token]
*oauth-access-token* ~access-token
*oauth-access-token-secret* ~access-token-secret]
(do
~@body)))

Expand Down Expand Up @@ -59,6 +61,7 @@ take any required and optional arguments and call the associated Twitter method.
*oauth-access-token*)
(oauth/credentials *oauth-consumer*
*oauth-access-token*
*oauth-access-token-secret*
~req-method
req-uri#
query-params#))]
Expand Down

0 comments on commit 7e6d0dd

Please sign in to comment.