Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added Oauth commands

  • Loading branch information...
commit 85a66850bbbb7216b484a901d744d92a502db9af 1 parent e673384
@adamwynne authored
Showing with 11 additions and 1 deletion.
  1. +1 −0  .gitignore
  2. +3 −1 project.clj
  3. +7 −0 src/twitter/api/restful.clj
View
1  .gitignore
@@ -6,3 +6,4 @@ empty.config
/lib/
/classes/
.lein-deps-sum
+.lein-plugins
View
4 project.clj
@@ -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"]
View
7 src/twitter/api/restful.clj
@@ -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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.