Web: Use github.com API v3 for "Recent Commits"
This commit is contained in:
parent
f967142436
commit
2e2eece085
|
@ -4,14 +4,14 @@ jQuery.fn.listCommits = function(username, repository, branch) {
|
||||||
this.html('<span>Querying GitHub for recent commits…</span>');
|
this.html('<span>Querying GitHub for recent commits…</span>');
|
||||||
|
|
||||||
var target = this;
|
var target = this;
|
||||||
$.getJSON('http://github.com/api/v2/json/commits/list/' + username + '/' + repository + '/' + branch + '?callback=?', function(data) {
|
$.getJSON('https://api.github.com/repos/' + username + '/' + repository + '/commits?sha=' + branch + '&callback=?', function(response) {
|
||||||
var repos = data.commits;
|
var commits = response.data;
|
||||||
|
|
||||||
var list = $('<ul/>');
|
var list = $('<ul/>');
|
||||||
target.empty().append(list);
|
target.empty().append(list);
|
||||||
$(repos).each(function(i) {
|
$(commits).each(function(i) {
|
||||||
var githubUrl = 'https://github.com' + this.url;
|
var githubUrl = 'https://github.com/' + username + '/' + repository + '/commit/' + this.sha;
|
||||||
var shortMessage = cutLines(this.message);
|
var shortMessage = cutLines(this.commit.message);
|
||||||
var author = this.author.login;
|
var author = this.author.login;
|
||||||
if (author == '') {
|
if (author == '') {
|
||||||
author = this.author.name;
|
author = this.author.name;
|
||||||
|
|
Loading…
Reference in New Issue