The API rate limit has been exceeded for your IP address. Please try again later.
+diff --git a/js/githubresume.js b/js/githubresume.js index 510eee5..88148df 100644 --- a/js/githubresume.js +++ b/js/githubresume.js @@ -94,9 +94,18 @@ var github_user_starred_resume = function(username, page) { dataType: 'json', success: function(data) { repos = data; + }, + error: function(e) { + if (e.status == 403) { + repos = 'api_limit' + } } }); + if (repos === 'api_limit') { + return repos; + } + $.each(repos, function(i, repo) { if (repo.full_name == "resume/resume.github.com") { star = true; @@ -118,17 +127,29 @@ var github_user_starred_resume = function(username, page) { var run = function() { var itemCount = 0, maxItems = 5, - maxLanguages = 9; + maxLanguages = 9, + starred = github_user_starred_resume(username); - if (! github_user_starred_resume(username)) { - $.ajax({ - url: 'views/opt_out.html', - dataType: 'html', - success: function(data) { - var template = data; - $('#resume').html(data); - } - }); + if (! starred || starred === 'api_limit') { + if (starred === 'api_limit') { + $.ajax({ + url: 'views/api_limit.html', + dataType: 'html', + success: function(data) { + var template = data; + $('#resume').html(data); + } + }); + } else { + $.ajax({ + url: 'views/opt_out.html', + dataType: 'html', + success: function(data) { + var template = data; + $('#resume').html(data); + } + }); + } return; } diff --git a/views/api_limit.html b/views/api_limit.html new file mode 100644 index 0000000..7d0821e --- /dev/null +++ b/views/api_limit.html @@ -0,0 +1,10 @@ +
The API rate limit has been exceeded for your IP address. Please try again later.
+