Last active
December 10, 2015 23:49
-
-
Save ArnaudLigny/4512483 to your computer and use it in GitHub Desktop.
Display Github repo list with javscript in HTML page.
This file contains hidden or 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
<div class="github-repos span-9 last"> | |
<h4>My Github Projects</h4> | |
<ul> | |
<li>Loading...</li> | |
</ul> | |
</div> | |
<div class="github-org-repos span-9 last"> | |
<h4>Baobaz Github Projects</h4> | |
<ul> | |
<li>Loading...</li> | |
</ul> | |
</div> |
This file contains hidden or 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
<script type="text/javascript"> | |
(function($) { | |
$(function() { | |
$.getJSON("https://api.github.com/users/narno/repos?callback=?", function(response) { | |
$("div.github-repos ul li").remove(); | |
$.each(response.data, function(idx, repo) { | |
if(!repo.fork) { | |
$("div.github-repos ul").append( | |
$("<li>").append( | |
$("<a>") | |
.html(repo["name"]) | |
.attr("href", repo["html_url"]) | |
) | |
); | |
} | |
}); | |
}); | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment