forked from Code52/code52.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrib.js
More file actions
49 lines (45 loc) · 1.39 KB
/
contrib.js
File metadata and controls
49 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function getContribs(projectName, projectUrl) {
$.ajax({
url: "http://github.com/api/v2/json/repos/show/Code52/" + projectName + "/contributors",
dataType: 'jsonp',
success: function(data)
{
data.contributors = data.contributors.sort(function (a, b)
{
if (a.contributions > b.contributions) return -1;
if (a.contributions < b.contributions) return 1;
return 0;
});
$("#contributors").append("<h2><a href=\"" + projectUrl + "\">"+ projectName +"</a></h2>");
$("#contributorTemplate").tmpl(data).appendTo("#contributors");
}
});
}
$(function()
{
$.ajax({
url: "http://github.com/api/v2/json/repos/show/code52",
dataType: 'jsonp',
success: function(data)
{
var count = data.repositories.length;
data.repositories = data.repositories.sort(function (a, b)
{
var adate = new Date(a.created_at).getTime();
var bdate = new Date(b.created_at).getTime();
if (adate < bdate) return -1;
if (adate > bdate) return 1;
return 0;
});
for(var i = 0; i < count; i++)
{
var repo = data.repositories[i];
if (repo.name != "code52.github.com"
&& repo.name != "NuGetGallery"
&& repo.name != "markdowndeep"
&& repo.name != "gh-pages-template")
getContribs(repo.name, repo.url);
}
}
});
});