class Github::Activity::Starring
Stars are shown next to repositories to show an approximate level of interest. # Stars have no effect on notifications or the activity feed.
Repository Starring is a feature that lets users bookmark repositories.
def list(*args)
github.activity.starring.list { |star| ... }
github.activity.starring.list
github = Github.new :user => 'user-name', :repo => 'repo-name'
= Examples
List stargazers
def list(*args) arguments(args, :required => [:user, :repo]) response = get_request("/repos/#{user}/#{repo}/stargazers", arguments.params) return response unless block_given? response.each { |el| yield el } end
def star(*args)
github.activity.starring.star 'user-name', 'repo-name'
github = Github.new
= Examples
You need to be authenticated to star a repository
Star a repository
def star(*args) arguments(args, :required => [:user, :repo]) put_request("/user/starred/#{user}/#{repo}", arguments.params) end
def starred(*args)
github.activity.starring.starred
github = Github.new :oauth_token => '...'
= Examples
List repos being starred by the authenticated user
github.activity.starring.starred :user => 'user-name'
github = Github.new
= Examples
List repos being starred by a user
def starred(*args) params = arguments(args).params response = if (user_name = params.delete('user')) get_request("/users/#{user_name}/starred", params) else get_request("/user/starred", params) end return response unless block_given? response.each { |el| yield el } end
def starring?(*args)
github.activity.starring.starring? 'user-name', 'repo-name'
github = Github.new
= Examples
Returns true if this repo is starred by you,false otherwise
Check if you are starring a repository
def starring?(*args) arguments(args, :required => [:user, :repo]) get_request("/user/starred/#{user}/#{repo}", arguments.params) true rescue Github::Error::NotFound false end
def unstar(*args)
github.activity.starring.unstar 'user-name', 'repo-name'
github = Github.new
= Examples
You need to be authenticated to unstar a repository.
Unstar a repository
def unstar(*args) arguments(args, :required => [:user, :repo]) delete_request("/user/starred/#{user}/#{repo}", arguments.params) end