I\'m trying build a method in which I can access a Github user name, and publish either all commits or at least a number of commits from that user.
Is there a call to GE
Maybe others are interested in this at later time.
There is no API for retrieving all the commits of one user -> you have to do it yourself.
The way you described it is good, but you missed out that from 2 and 4 you will get all commits, not only of that user.
Github API allows you to get the list of commits by author filtering https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository
My suggestion is to do the following:
Retrieve the repositories of that user, parse the JSON response and get the names of the repository in an array.
api.github.com/users/:user/repos
:user
with your desired user.For each repository, get the list of commits authored by that user.
api.github.com/repos/:user/{repositoryNameFromArray}/commits?author=:user
.:user
with your desired user, and {repositoryNameFromArray}
should come from your array.Here be careful that Github retrieves by default only the last 30 commits. You need to use pagination to get larger chunks, max 100.
You're done. The rest is up to you and what you want to do with the data.