Reputation: 6436
Is there an efficient way to find all recent commits by a specific user across all public repos?
I am currently use /events/public
and filtering out those event.type === "PushEvent"
. However this is not very efficient because
PushEvent
does not have timestamp, which means I need additional requests to fetch their timestamps through commits[][url]
.Is there any better way to do this?
Upvotes: 0
Views: 560
Reputation: 9250
No unfortunately there is no better way to retrieve commits for the user. However there is a workaround for the rate limit:
Documentation says
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.
You can generate an access token and use it as an OAuth token.
How to use token
If you're going to use Basic Authentication you need to add new header
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
where the string after Basic
is a Base64 encoded string of
your_user_name:your_token
If you're using curl
curl -u username:token https://api.github.com/user
or
curl https://username:[email protected]/
Upvotes: 1