Last active
August 29, 2015 14:14
-
-
Save systemist/baf5c7e49238c066b38c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link rel="stylesheet" href="bower_components/octicons/octicons/octicons.css"> | |
</head> | |
<body> | |
<ul class="repositories"> | |
</ul> | |
<script src="bower_components/jquery/dist/jquery.js"></script> | |
<script src="bower_components/underscore/underscore.js"></script> | |
<script type="text/template" data-template-name="repo"> | |
<li> | |
<a href="<%= html_url %>"><%= name %></a> | |
<%= pushed_at %> | |
<%= language %> | |
<%= stargazers_count %> | |
<%= forks_count %> | |
<%= stargazers_url %> | |
<%= forks_url %> | |
</li> | |
</script> | |
<script src="main.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var baseUrl = "https://api.github.com/users/jacobthemyth/"; | |
$(document).ready(function(){ | |
if(typeof githubToken !== 'undefined'){ | |
$.ajaxSetup({ | |
headers: { 'Authorization': 'token ' + githubToken } | |
}); | |
} | |
var repoTemplate = _.template($('[data-template-name=repo]').text()) | |
var $repositoriesUl = $('.repositories'); | |
$.ajax(baseUrl + "repos").done(function(repos){ | |
_.each(repos, function(repo) { | |
$repositoriesUl.append(repoTemplate(repo)); | |
}); | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment