GitHub API 通过带时间戳的用户 ID 查找所有提交

GitHub API find all commits by user ID with timestamp

是否有一种有效的方法来查找特定用户在所有 public 个存储库中的所有最近提交?

我目前正在使用 /events/public 并过滤掉那些 event.type === "PushEvent"。然而,这不是很有效,因为

有更好的方法吗?

不,不幸的是,没有更好的方法来为用户检索提交。 但是,速率限制有一个解决方法:

Documentation

For requests using Basic Authentication or OAuth, you can make up to 5,000 requests per hour. For unauthenticated requests, the rate limit allows you to make up to 60 requests per hour.

您可以生成一个 access token and use it as an OAuth token

如何使用token

如果您要使用 Basic Authentication 你需要添加新的 header

Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

其中 Basic 之后的字符串是

Base64 encoded 字符串
your_user_name:your_token

如果您正在使用 curl

curl -u username:token https://api.github.com/user

curl https://username:token@api.github.com/