我正在尝试使用github api获取仓库所有贡献者的信息。
如果没有错误的话,它还会告诉我,当一个仓库有超过500个贡献者时,仅给出其中的500个,并将剩余的标记为匿名。
出于性能考虑,仓库中仅链接到GitHub用户的前500个作者电子邮件地址。
这个仓库Linux内核有5k+个贡献者,根据api,我应该通过api至少可以获得500个贡献者。
当我运行curl -I https://api.github.com/repos/torvalds/linux/contributors?per_page=100
我只收到了3页(每页100个),所以我只得到了>300个贡献者。(看一下“link”头)
是否有办法获取仓库的所有贡献者(5000+)?
HTTP/1.1 200 OK
Server: GitHub.com
Date: Thu, 19 Nov 2015 18:00:54 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 100308
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 56
X-RateLimit-Reset: 1447958881
Cache-Control: public, max-age=60, s-maxage=60
Last-Modified: Thu, 19 Nov 2015 16:06:38 GMT
ETag: "a57e0f74fc68e1791da15d33fa044616"
Vary: Accept
X-GitHub-Media-Type: github.v3
Link: <https://api.github.com/repositories/2325298/contributors?per_page=100&page=2>; rel="next", <https://api.github.com/repositories/2325298/contributors?per_page=100&page=3>; rel="last"
X-XSS-Protection: 1; mode=block
X-Frame-Options: deny
Content-Security-Policy: default-src 'none'
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
X-Served-By: a30e6f9aa7cf5731b87dfb3b9992202d
X-GitHub-Request-Id: 67E881D2:146C9:24CF1BB3:564E0E55