Skip to content

Commit

Permalink
Merge pull request #13 from franckcuny/master
Browse files Browse the repository at this point in the history
Add support for the starring API.
  • Loading branch information
Raynes committed Sep 12, 2012
2 parents f10ac77 + 84b15c9 commit 68d4028
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/tentacles/repos.clj
Expand Up @@ -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
Expand Down

0 comments on commit 68d4028

Please sign in to comment.