aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Lü <zlu@me.com>2012-07-19 22:09:48 -0700
committerZhao Lü <zlu@me.com>2012-07-19 22:09:48 -0700
commit0d14d9cd0692fe6cf65e27f49da0247f98a45cdf (patch)
tree77f8508294a9f0ecde17759777783f16cb3e0cc1
parentf5b6df5a576da5524b29f9f1956c7d7befbc4825 (diff)
downloadmy_new_personal_website-0d14d9cd0692fe6cf65e27f49da0247f98a45cdf.tar.xz
my_new_personal_website-0d14d9cd0692fe6cf65e27f49da0247f98a45cdf.zip
Updated Github API to V3.
Github API V2 has been removed. The response data format also changed.
-rw-r--r--.themes/classic/source/javascripts/github.js10
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(),