Skip to content

Instantly share code, notes, and snippets.

@Stankye
Created August 2, 2019 20:52
Show Gist options
  • Save Stankye/ddc2d90627465134ef515af770f007ea to your computer and use it in GitHub Desktop.
Save Stankye/ddc2d90627465134ef515af770f007ea to your computer and use it in GitHub Desktop.
from github import Github # pip install github
# Github API Token
ACCESS_TOKEN= ''
# Github Users stars you want to hoard
githubUser = 'stankye'
# File name you want to save as
fileName = 'myStars.txt'
gh = Github(ACCESS_TOKEN)
def get_stars():
f = open(fileName, "a")
result = gh.get_user(githubUser).get_starred() # get all of the starz
for repo in result:
print(repo.clone_url, file=f) # Change from clone_url if you want something else: https://developer.github.com/v3/repos/#list-user-repositories
f.close()
return
get_stars()
print('Finished: Files saved to: ' + fileName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment