diff options
author | Zhao Lü <zlu@me.com> | 2012-07-19 22:09:48 -0700 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2012-09-09 14:50:00 -0500 |
commit | 53ca59d6d0aa79b67ef89dbef16d2550df97e11d (patch) | |
tree | ed6236fabc796ba4d750160421d4d402f3066e91 | |
parent | 17c1c915095e6579b8c21fd568f725ae3dc4edc5 (diff) | |
download | my_new_personal_website-53ca59d6d0aa79b67ef89dbef16d2550df97e11d.tar.xz my_new_personal_website-53ca59d6d0aa79b67ef89dbef16d2550df97e11d.zip |
Updated Github API to V3.
Github API V2 has been removed. The response data format also changed.
Diffstat (limited to '')
-rw-r--r-- | .themes/classic/source/javascripts/github.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js index 678775a9..8b79dad1 100644 --- a/.themes/classic/source/javascripts/github.js +++ b/.themes/classic/source/javascripts/github.js @@ -10,15 +10,15 @@ var github = (function(){ return { showRepos: function(options){ $.ajax({ - url: "http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?" + url: "https://api.github.com/users/"+options.user+"/repos?callback=?" , type: 'jsonp' , error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); } , success: function(data) { var repos = []; - if (!data || !data.repositories) { return; } - for (var i = 0; i < data.repositories.length; i++) { - if (options.skip_forks && data.repositories[i].fork) { continue; } - repos.push(data.repositories[i]); + if (!data || !data.data) { return; } + for (var i = 0; i < data.data.length; i++) { + if (options.skip_forks && data.data[i].fork) { continue; } + repos.push(data.data[i]); } repos.sort(function(a, b) { var aDate = new Date(a.pushed_at).valueOf(), |