mbleigh (owner)

Revisions

gist: 61597 Download_button fork
public
Public Clone URL: git://gist.github.com/61597.git
Embed All Files: show embed
github-project-puller.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  jQuery.githubUser = function(username, callback) {
    jQuery.getJSON("http://github.com/api/v1/json/" + username + "?callback=?", callback);
  }
 
  $.githubUser('mbleigh', function(data) {
    $('#github-projects').html('');
    
    var repos = data.user.repositories;
    repos.sort(function(a,b) {
      return b.watchers - a.watchers;
    });
    
    $(repos).each(function() {
      $('#github-projects').append("\
<div class='repo'>\
<h3><a href='" + this.url + "'>" + this.name + "</a></h3>\
<span class='desc'>"+this.description+"</span>\
</div>");
    });
  });