Skip to content

Commit

Permalink
added Oauth commands
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwynne committed Apr 18, 2012
1 parent e673384 commit 85a6685
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ empty.config
/lib/
/classes/
.lein-deps-sum
.lein-plugins
4 changes: 3 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(defproject twitter-api/twitter-api "0.6.4"
(defproject twitter-api/twitter-api "0.6.5"
:description "full twitter interface"
:plugins [[lein-clojars "0.7.0"]
[lein-swank "1.4.4"]]
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/data.json "0.1.1"]
[org.clojars.adamwynne/http.async.client "0.4.1"]
Expand Down
7 changes: 7 additions & 0 deletions src/twitter/api/restful.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def ^:dynamic *rest-api* (ApiContext. "http" "api.twitter.com" 1))
(def ^:dynamic *secure-rest-api* (ApiContext. "https" "api.twitter.com" 1))
(def ^:dynamic *rest-upload-api* (ApiContext. "http" "upload.twitter.com" 1))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -78,6 +79,12 @@
(def-twitter-restful-method daily-trends :get "trends/daily.json")
(def-twitter-restful-method weekly-trends :get "trends/weekly.json")

;; Oauth
(def-twitter-restful-method oauth-authenticate :get "oauth/authenticate.json" :api *secure-rest-api*)
(def-twitter-restful-method oauth-authorize :get "oauth/authorize.json" :api *secure-rest-api*)
(def-twitter-restful-method oauth-access-token :post "oauth/access_token.json" :api *secure-rest-api*)
(def-twitter-restful-method oauth-request-token :post "oauth/request_token.json" :api *secure-rest-api*)

;; Local trends
(def-twitter-restful-method location-trends :get "trends/available.json")
(def-twitter-restful-method location-trend :get "trends/{:woeid}.json")
Expand Down

0 comments on commit 85a6685

Please sign in to comment.