forked from amanjain25/hacktoberfest18-ft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (42 loc) · 1.22 KB
/
index.js
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
var users = [];
var i = 0;
var getData = (function($) {
var URL =
"https://api.github.com/repos/rowhitswami/hacktoberfest18-ft/contributors?per_page=300";
$.get(URL, function(data, status) {
if (data.length > 0) {
data.forEach(function(user) {
if (users.indexOf(user.login) == -1) {
var name = user.login || "";
if (user.type !== "User") {
name = "Anonymous";
}
var template =
"<div class='col-md-3 col-xs-6 col-lg-3' id='author'><div class='container-fluid'>" +
"<a class='thumbnail' target='_blank' href='" +
user.html_url +
"'>" +
"<img src='" +
user.avatar_url +
"' alt='' class='img-responsive'>" +
"</a>" +
"<div class='caption'>" +
"<a target='_blank' href='" +
user.html_url +
"'>" +
"<strong>" +
user.login +
"</strong>" +
"</a>" +
"<p>" +
name +
"</p>" +
"</div></div></div>";
$("#contributors").append(template);
users[i] = user.login;
i = i + 1;
}
});
}
});
})($);