To get more than 100
repositories from GitHub it's necessary to follow the links inside the link header .
import requests
def get_repositories(url):
result = []
r = requests.get(url=url)
if 'next' in r.links :
result += get_repositories(r.links['next']['url'])
for repository in r.json():
result.append(repository.get('name'))
return result
url = "https://api.github.com/users/stackforge/repos"
print get_repositories(url)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.