-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgithub.js
More file actions
26 lines (26 loc) · 1020 Bytes
/
github.js
File metadata and controls
26 lines (26 loc) · 1020 Bytes
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
/*
Display all public members of Code Island organization, via GitHub API.
For unauthenticated requests, we're allowed up to 60 per hour, per IP address.
API Docs: https://developer.github.com/v3/orgs/members/#members-list
*/
var html = "";
$.ajax( {
url : "https://api.github.com/orgs/codeisland/public_members",
dataType : "jsonp",
success : function ( returndata ) {
$.each( returndata.data, function ( i, item ) {
memberTotal = returndata.data.length;
memberLogin = this.login;
memberURL = this.html_url;
memberAvatar = this.avatar_url;
html += '<li class="do-gooder">' +
'<a href="' + memberURL + '">' +
'<img class="avatar" src="' + memberAvatar + '">' +
'<h1 class="username">' + memberLogin + '</h1>' +
'</a>' +
'</li>';
});
$( '#members-total' ).prepend(memberTotal);
$( '#members-details' ).append(html).append('</ul></div>');
} // close success handler
});