From c53a9168423261f7279669ad32e7fc7ad6797f46 Mon Sep 17 00:00:00 2001 From: Adam Anderly Date: Tue, 4 Nov 2014 15:13:59 -0600 Subject: [PATCH] Added wordpress functional examples in comments. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ‘ total’ to end of /wordpress/plugin/dt/ badgeText Added ‘ tested’ to end of /wordpress/v/ badgeText to better reflect meaning. --- server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 4d26369..4d5a7a1 100644 --- a/server.js +++ b/server.js @@ -2136,6 +2136,7 @@ cache(function(data, match, sendBadge, request) { })); // wordpress plugin version integration. +// example: https://img.shields.io/wordpress/plugin/v/akismet.svg for https://wordpress.org/plugins/akismet camp.route(/^\/wordpress\/plugin\/v\/(.*)\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var plugin = match[1]; // eg, `localeval`. @@ -2165,6 +2166,7 @@ cache(function(data, match, sendBadge, request) { })); // wordpress plugin downloads integration. +// example: https://img.shields.io/wordpress/plugin/dt/akismet.svg for https://wordpress.org/plugins/akismet camp.route(/^\/wordpress\/plugin\/dt\/(.*)\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var plugin = match[1]; // eg, `localeval`. @@ -2184,7 +2186,7 @@ cache(function(data, match, sendBadge, request) { sendBadge(format, badgeData); return; } - badgeData.text[1] = metric(total); + badgeData.text[1] = metric(total) + ' total'; if (total === 0) { badgeData.colorscheme = 'red'; } else if (total < 100) { @@ -2201,6 +2203,7 @@ cache(function(data, match, sendBadge, request) { })); // wordpress plugin rating integration. +// example: https://img.shields.io/wordpress/plugin/r/akismet.svg for https://wordpress.org/plugins/akismet camp.route(/^\/wordpress\/plugin\/r\/(.*)\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var plugin = match[1]; // eg, `localeval`. @@ -2238,6 +2241,7 @@ cache(function(data, match, sendBadge, request) { })); // wordpress version support integration. +// example: https://img.shields.io/wordpress/v/akismet.svg for https://wordpress.org/plugins/akismet camp.route(/^\/wordpress\/v\/(.*)\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var plugin = match[1]; // eg, `localeval`. @@ -2254,7 +2258,7 @@ cache(function(data, match, sendBadge, request) { var pluginVersion = data.version; if (data.tested) { var testedVersion = data.tested.replace(/[^0-9.]/g,''); - badgeData.text[1] = testedVersion; + badgeData.text[1] = testedVersion + ' tested'; var coreUrl = 'https://api.wordpress.org/core/version-check/1.7/'; request(coreUrl, function(err, res, response) { var versions = JSON.parse(response).offers.map(function(v) {