Permalink
Browse files

Merge pull request #13 from franckcuny/master

Add support for the starring API.
  • Loading branch information...
2 parents f10ac77 + 84b15c9 commit 68d4028bca034f479b95b562cd19d3be86531176 @Raynes committed Sep 12, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 src/tentacles/repos.clj
View
@@ -311,6 +311,33 @@
[user repo options]
(no-content? (api-call :delete "user/watched/%s/%s" [user repo] options)))
+;; ## Repo Stargazers
+
+(defn stargazers
+ "List a repository's stargazers."
+ [user repo & [options]]
+ (api-call :get "repos/%s/%s/stargazers" [user repo] options))
+
+(defn starring
+ "List all the repositories that a user is starring."
+ [user & [options]]
+ (api-call :get "users/%s/starred" [user] options))
+
+(defn starring?
+ "Check if you are watching a repository."
+ [user repo options]
+ (no-content? (api-call :get "user/starred/%s/%s" [user repo] options)))
+
+(defn star
+ "Star a repository."
+ [user repo options]
+ (no-content? (api-call :put "user/starred/%s/%s" [user repo] options)))
+
+(defn unstar
+ "Unstar a repository"
+ [user repo options]
+ (no-content? (api-call :delete "user/starred/%s/%s" [user repo] options)))
+
;; ## Repo Hooks API
(defn hooks

0 comments on commit 68d4028

Please sign in to comment.