Po pierwsze, można show the commits for a given file:
https://api.github.com/repos/:owner/:repo/commits?path=PATH_TO_FILE
Na przykład:
https://api.github.com/repos/git/git/commits?path=README
drugie, że odpowiedź JSON robi , w sekcji autora znajduje się adres URL o nazwie "html_url
'do profilu GitHub:
"author": {
"login": "gitster",
"id": 54884,
"avatar_url": "https://0.gravatar.com/avatar/750680c9dcc7d0be3ca83464a0da49d8?d=https%3A%2F%2Fidenticons.github.com%2Ff8e73a1fe6b3a5565851969c2cb234a7.png",
"gravatar_id": "750680c9dcc7d0be3ca83464a0da49d8",
"url": "https://api.github.com/users/gitster",
"html_url": "https://github.com/gitster", <==========
"followers_url": "https://api.github.com/users/gitster/followers",
"following_url": "https://api.github.com/users/gitster/following{/other_user}",
"gists_url": "https://api.github.com/users/gitster/gists{/gist_id}",
"starred_url": "https://api.github.com/users/gitster/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gitster/subscriptions",
"organizations_url": "https://api.github.com/users/gitster/orgs",
"repos_url": "https://api.github.com/users/gitster/repos",
"events_url": "https://api.github.com/users/gitster/events{/privacy}",
"received_events_url": "https://api.github.com/users/gitster/received_events",
"type": "User"
},
Nie powinieneś więc potrzebować zeskanować żadnej strony tutaj.
Oto very crude jsfiddle zilustrować, że na podstawie wyciągu javascript:
var url = "https://api.github.com/repos/git/git/commits?path=" + filename
$.getJSON(url, function(data) {
var twitterList = $("<ul />");
$.each(data, function(index, item) {
if(item.author) {
$("<li />", {
"text": item.author.html_url
}).appendTo(twitterList);
}
});
Jak zawsze, jest przyjemnością przeczytać odpowiedzi, Von. Kompleksowe i na temat. –
Dzięki. Właśnie tego szukałem. Zobaczę, czy będą dostępne alternatywne odpowiedzi, zanim wydam nagrodę. –
OK wyniki można zobaczyć tutaj: https://github.com/miohtama/sphinxcontrib.contributors/ :) –