diff --git a/index.html b/index.html index 3e276c9..079c279 100644 --- a/index.html +++ b/index.html @@ -232,19 +232,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable

Downloads

- + - + - + - + @@ -467,15 +467,15 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable - + - + - + @@ -555,19 +555,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable

Social

Github All Releases:
Github All Releases: https://img.shields.io/github/downloads/atom/atom/total.svg
Github Releases:
Github Releases: https://img.shields.io/github/downloads/atom/atom/latest/total.svg
Github Releases (by Release):
Github Releases (by Release): https://img.shields.io/github/downloads/atom/atom/v0.190.0/total.svg
Github Releases (by Asset):
Github Releases (by Asset): https://img.shields.io/github/downloads/atom/atom/latest/atom-amd64.deb.svg
https://img.shields.io/hexpm/v/plug.svg
GitHub tag:
GitHub tag: https://img.shields.io/github/tag/strongloop/express.svg
GitHub release:
GitHub release: https://img.shields.io/github/release/qubyte/rubidium.svg
GitHub commits:
GitHub commits: https://img.shields.io/github/commits-since/SubtitleEdit/subtitleedit/3.4.7.svg
- + - + - + - + @@ -695,19 +695,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable - + - + - + - + @@ -1087,6 +1087,14 @@ is where the current server got started.
GitHub forks:
GitHub forks: https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Fork
GitHub stars:
GitHub stars: https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star
GitHub watchers:
GitHub watchers: https://img.shields.io/github/watchers/badges/shields.svg?style=social&label=Watch
GitHub followers:
GitHub followers: https://img.shields.io/github/followers/espadrine.svg?style=social&label=Follow
https://img.shields.io/wheelmap/a/2323004600.svg
GitHub issues:
GitHub issues: https://img.shields.io/github/issues/badges/shields.svg
https://img.shields.io/github/issues-raw/badges/shields.svg
label:
label: https://img.shields.io/github/issues-raw/badges/shields/website.svg
license:
license: https://img.shields.io/github/license/mashape/apistatus.svg

+
+

If your GitHub badge errors, it might be because you hit GitHub's rate + limits.
+ You can increase Shield.io's rate limit by + going to this page + to add Shields as a GitHub application on your GitHub account. +

+
diff --git a/lib/github-auth.js b/lib/github-auth.js index b7e4442..9ce9716 100644 --- a/lib/github-auth.js +++ b/lib/github-auth.js @@ -221,6 +221,7 @@ function githubRequest(request, url, query, cb) { console.log('GitHub auth: token', githubToken, 'rate limit', remaining, 'reset', reset, 'now', utcEpochSeconds()); setReqRemaining(githubToken, remaining, reset); + if (remaining === 0) { return; } // Hope for the best in the cache. } } cb(err, res, buffer); diff --git a/server.js b/server.js index 5394fca..151e6dc 100644 --- a/server.js +++ b/server.js @@ -2818,9 +2818,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); var versions = data.map(function(e) { return e.name; }); var tag = latestVersion(versions); @@ -2853,9 +2850,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); var version = data.tag_name; var prerelease = data.prerelease; @@ -2889,9 +2883,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); badgeData.text[1] = data.ahead_by; badgeData.colorscheme = 'blue'; @@ -2935,9 +2926,6 @@ cache(function(data, match, sendBadge, request) { return sendBadge(format, badgeData); } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); var downloads = 0; @@ -3005,9 +2993,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); var modifier = ''; if (issuesApi) { @@ -3049,9 +3034,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } var data = JSON.parse(buffer); var forks = data.forks_count; badgeData.text[1] = forks; @@ -3087,9 +3069,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } badgeData.text[1] = JSON.parse(buffer).stargazers_count; badgeData.colorscheme = null; badgeData.colorB = '#4183C4'; @@ -3123,9 +3102,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } badgeData.text[1] = JSON.parse(buffer).subscribers_count; badgeData.colorscheme = null; badgeData.colorB = '#4183C4'; @@ -3154,9 +3130,6 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } badgeData.text[1] = JSON.parse(buffer).followers; badgeData.colorscheme = null; badgeData.colorB = '#4183C4'; @@ -3199,9 +3172,7 @@ cache(function(data, match, sendBadge, request) { return; } try { - if ((+res.headers['x-ratelimit-remaining']) === 0) { - return; // Hope for the best in the cache. - } else if (res.statusCode === 404) { + if (res.statusCode === 404) { badgeData.text[1] = 'repo not found'; sendBadge(format, badgeData); return; diff --git a/try.html b/try.html index f190f36..a1310f9 100644 --- a/try.html +++ b/try.html @@ -231,19 +231,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable

Downloads

- + - + - + - + @@ -466,15 +466,15 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable - + - + - + @@ -554,19 +554,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable

Social

Github All Releases:
Github All Releases: https://img.shields.io/github/downloads/atom/atom/total.svg
Github Releases:
Github Releases: https://img.shields.io/github/downloads/atom/atom/latest/total.svg
Github Releases (by Release):
Github Releases (by Release): https://img.shields.io/github/downloads/atom/atom/v0.190.0/total.svg
Github Releases (by Asset):
Github Releases (by Asset): https://img.shields.io/github/downloads/atom/atom/latest/atom-amd64.deb.svg
https://img.shields.io/hexpm/v/plug.svg
GitHub tag:
GitHub tag: https://img.shields.io/github/tag/strongloop/express.svg
GitHub release:
GitHub release: https://img.shields.io/github/release/qubyte/rubidium.svg
GitHub commits:
GitHub commits: https://img.shields.io/github/commits-since/SubtitleEdit/subtitleedit/3.4.7.svg
- + - + - + - + @@ -694,19 +694,19 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable - + - + - + - + @@ -1086,6 +1086,14 @@ is where the current server got started.
GitHub forks:
GitHub forks: https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Fork
GitHub stars:
GitHub stars: https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star
GitHub watchers:
GitHub watchers: https://img.shields.io/github/watchers/badges/shields.svg?style=social&label=Watch
GitHub followers:
GitHub followers: https://img.shields.io/github/followers/espadrine.svg?style=social&label=Follow
https://img.shields.io/wheelmap/a/2323004600.svg
GitHub issues:
GitHub issues: https://img.shields.io/github/issues/badges/shields.svg
https://img.shields.io/github/issues-raw/badges/shields.svg
label:
label: https://img.shields.io/github/issues-raw/badges/shields/website.svg
license:
license: https://img.shields.io/github/license/mashape/apistatus.svg

+
+

If your GitHub badge errors, it might be because you hit GitHub's rate + limits.
+ You can increase Shield.io's rate limit by + going to this page + to add Shields as a GitHub application on your GitHub account. +

+