-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.js
33 lines (29 loc) · 969 Bytes
/
custom.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
jQuery(document).ready(function() {
$('#gf').text('GitHub Followers');
$('#gfr').text('GitHub Repos');
JSONP( 'https://api.github.com/users/hep-puppet?callback=?', function( response ) {
var data = response.data;
$('#gf').text(data.followers + ' GitHub Followers');
$('#gfr').text(data.public_repos + ' GitHub Repos');
});
function JSONP( url, callback ) {
var id = ( 'jsonp' + Math.random() * new Date() ).replace('.', '');
var script = document.createElement('script');
script.src = url.replace( 'callback=?', 'callback=' + id );
document.body.appendChild( script );
window[ id ] = function( data ) {
if (callback) {
callback( data );
}
};
}
$('#ghw').githubWidget({
'username': 'HEP-Puppet',
'displayActions': false,
'firstCount': 10,
'displayHeader': false,
'displayLastCommit': false,
'displayAccountInformations': false,
'displayLanguage': false
});
});