Skip to content

Instantly share code, notes, and snippets.

@michaelcolenso
Created October 9, 2012 06:20
Show Gist options
  • Save michaelcolenso/3856959 to your computer and use it in GitHub Desktop.
Save michaelcolenso/3856959 to your computer and use it in GitHub Desktop.
<!-- get my watched repos from github and display in the sidebar -->
<script>
$(document).ready(function () {
var html = "";
$.ajax( {
url : "https://api.github.com/users/michaelcolenso/watched",
dataType : "jsonp",
success : function ( returndata ) {
$.each( returndata.data, function ( i, item ) {
html += '<li>' +
'<h3><a href="' + this.html_url + '">' + this.name + '</a></h3>' +
'<ul>' +
'<li>' + 'Description: ' + this.description + '</li>' +
'<li>' + 'Language: ' + this.language + '</li>' +
'<li>' + 'Updated: ' + this.updated_at + '</li>' +
'<li>' + 'Owner: ' + this.owner.login + '</li>' +
'</ul>' +
'</li>';
});
$( '#result' ).append( html );
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment