我使用以下代码获取存储库的星标,但它只返回Bootstrap存储库的40000个星标,低于实际的70717个星标。然而,它返回正确的JQuery存储库的星标(31445)。为什么检索Bootstrap的星标不正确?
#!/usr/bin/python
from github import Github
# XXX: Specify your own access token here
ACCESS_TOKEN = ''
client = Github(ACCESS_TOKEN, per_page=100)
# Specify a username and repository of interest for that user.
REPO_LIST=[('twbs','bootstrap'),('jquery','jquery')]
for USER,REPO in REPO_LIST:
user = client.get_user(USER)
repo = user.get_repo(REPO)
# Get a list of people who have bookmarked the repo.
# Since you'll get a lazy iterator back, you have to traverse
# it if you want to get the total number of stargazers.
stargazers = [ s for s in repo.get_stargazers() ]
print("Number of stargazers", len(stargazers))