Skip to content

Instantly share code, notes, and snippets.

@jackfischer
Created October 14, 2016 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackfischer/af4819c57b0b6fbcf036bc5eb1d61980 to your computer and use it in GitHub Desktop.
Save jackfischer/af4819c57b0b6fbcf036bc5eb1d61980 to your computer and use it in GitHub Desktop.
from github import Github
username = "username"
password = "pass"
g = Github(username, password)
user = g.get_user()
pages = user.get_repos()
i = 1
repos = []
while pages.get_page(i):
temp = pages.get_page(i)
temp = [r for r in temp if r.owner.login.lower() == username]
repos.extend(temp)
i += 1
results = dict()
for r in repos:
starPages = r.get_stargazers_with_dates()
i = 0
stars = []
while starPages.get_page(i):
stars.extend(starPages.get_page(i))
i += 1
results[r.full_name] = stars
for repo in sorted(results):
print(repo)
for star in sorted(results[repo], key=lambda s: s.user.login):
print("%s %s" % (star.user.login, str(star.starred_at)))
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment