{"action":"created","comment":{"url":"https://api.github.com/repos/badges/shields/pulls/comments/30209986","id":30209986,"diff_hunk":"@@ -3179,22 +3179,53 @@ cache(function (data, match, sendBadge, request) {\n     }\n     try {\n       var data = JSON.parse(buffer);\n-        if (info === 'v') {\n-          var vdata = versionColor(data);\n-          badgeData.text[1] = vdata.version;\n-          badgeData.colorscheme = vdata.color;\n-          sendBadge(format, badgeData);\n-        } else if (info == 'l') {\n-          var license = data.info.license;\n-          badgeData.text[0] = 'license';\n-          if (license == null) {\n-            badgeData.text[1] = 'Unknown';\n-          } else {\n-            badgeData.text[1] = license;\n-            badgeData.colorscheme = 'blue';\n-          }\n-          sendBadge(format, badgeData);\n+      if (info === 'v') {\n+        var vdata = versionColor(data);\n+        badgeData.text[1] = vdata.version;\n+        badgeData.colorscheme = vdata.color;\n+        sendBadge(format, badgeData);\n+      } else if (info == 'l') {\n+        var license = data.info.license;\n+        badgeData.text[0] = 'license';\n+        if (license == null) {\n+          badgeData.text[1] = 'Unknown';\n+        } else {\n+          badgeData.text[1] = license;\n+          badgeData.colorscheme = 'blue';\n         }\n+        sendBadge(format, badgeData);\n+      }\n+    } catch(e) {\n+      badgeData.text[1] = 'invalid';\n+      sendBadge(format, badgeData);\n+    }\n+  });\n+}));\n+\n+// Docker Hub stars integration.\n+camp.route(/^\\/docker\\/stars\\/([^\\/]+)\\/([^\\/]+)\\.(svg|png|gif|jpg|json)$/,\n+cache(function(data, match, sendBadge, request) {\n+  var user = match[1];  // eg, _ or mashape\n+  var repo = match[2];  // eg, mockbin\n+  var format = match[3];\n+  // Convert underscore to library for api path\n+  var baseURL = 'http://docker.cloudbrain.io/';\n+  var path = user+'/'+repo;\n+  var badgeData = getBadgeData('docker', data);\n+  request(baseURL+path, function(err, res, buffer) {\n+    if (err != null) {\n+      badgeData.text[1] = 'inaccessible';\n+      sendBadge(format, badgeData);\n+      return;\n+    }\n+    try {\n+      var data = JSON.parse(buffer);\n+      var stars = data.stars;\n+      var starSuffix = data.stars === 1 ? \" star\" : \" stars\"\n+      badgeData.text[1] = metric(stars) + starSuffix;\n+      badgeData.colorscheme = null;\n+      badgeData.colorB = '#008bb8';","path":"server.js","position":null,"original_position":64,"commit_id":"ee99fb87abdf5b74634d10b02a57ba9d0e089450","original_commit_id":"97566abfdfb18c213e59f67a686557ea46589d7c","user":{"login":"montanaflynn","id":24260,"avatar_url":"https://avatars.githubusercontent.com/u/24260?v=3","gravatar_id":"","url":"https://api.github.com/users/montanaflynn","html_url":"https://github.com/montanaflynn","followers_url":"https://api.github.com/users/montanaflynn/followers","following_url":"https://api.github.com/users/montanaflynn/following{/other_user}","gists_url":"https://api.github.com/users/montanaflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/montanaflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montanaflynn/subscriptions","organizations_url":"https://api.github.com/users/montanaflynn/orgs","repos_url":"https://api.github.com/users/montanaflynn/repos","events_url":"https://api.github.com/users/montanaflynn/events{/privacy}","received_events_url":"https://api.github.com/users/montanaflynn/received_events","type":"User","site_admin":false},"body":"It's the docker color, as discussed in the initial request: https://github.com/badges/shields/issues/415#issuecomment-91587730","created_at":"2015-05-13T08:13:20Z","updated_at":"2015-05-13T08:13:20Z","html_url":"https://github.com/badges/shields/pull/417#discussion_r30209986","pull_request_url":"https://api.github.com/repos/badges/shields/pulls/417","_links":{"self":{"href":"https://api.github.com/repos/badges/shields/pulls/comments/30209986"},"html":{"href":"https://github.com/badges/shields/pull/417#discussion_r30209986"},"pull_request":{"href":"https://api.github.com/repos/badges/shields/pulls/417"}}},"pull_request":{"url":"https://api.github.com/repos/badges/shields/pulls/417","id":33057352,"html_url":"https://github.com/badges/shields/pull/417","diff_url":"https://github.com/badges/shields/pull/417.diff","patch_url":"https://github.com/badges/shields/pull/417.patch","issue_url":"https://api.github.com/repos/badges/shields/issues/417","number":417,"state":"open","locked":false,"title":"Add docker stars integration","user":{"login":"montanaflynn","id":24260,"avatar_url":"https://avatars.githubusercontent.com/u/24260?v=3","gravatar_id":"","url":"https://api.github.com/users/montanaflynn","html_url":"https://github.com/montanaflynn","followers_url":"https://api.github.com/users/montanaflynn/followers","following_url":"https://api.github.com/users/montanaflynn/following{/other_user}","gists_url":"https://api.github.com/users/montanaflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/montanaflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montanaflynn/subscriptions","organizations_url":"https://api.github.com/users/montanaflynn/orgs","repos_url":"https://api.github.com/users/montanaflynn/repos","events_url":"https://api.github.com/users/montanaflynn/events{/privacy}","received_events_url":"https://api.github.com/users/montanaflynn/received_events","type":"User","site_admin":false},"body":"As requested in #415 ","created_at":"2015-04-10T15:32:51Z","updated_at":"2015-05-13T08:13:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d55cbff79dc86b933d1f988851f1bc33448b5658","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/badges/shields/pulls/417/commits","review_comments_url":"https://api.github.com/repos/badges/shields/pulls/417/comments","review_comment_url":"https://api.github.com/repos/badges/shields/pulls/comments{/number}","comments_url":"https://api.github.com/repos/badges/shields/issues/417/comments","statuses_url":"https://api.github.com/repos/badges/shields/statuses/ee99fb87abdf5b74634d10b02a57ba9d0e089450","head":{"label":"montanaflynn:docker-stars","ref":"docker-stars","sha":"ee99fb87abdf5b74634d10b02a57ba9d0e089450","user":{"login":"montanaflynn","id":24260,"avatar_url":"https://avatars.githubusercontent.com/u/24260?v=3","gravatar_id":"","url":"https://api.github.com/users/montanaflynn","html_url":"https://github.com/montanaflynn","followers_url":"https://api.github.com/users/montanaflynn/followers","following_url":"https://api.github.com/users/montanaflynn/following{/other_user}","gists_url":"https://api.github.com/users/montanaflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/montanaflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montanaflynn/subscriptions","organizations_url":"https://api.github.com/users/montanaflynn/orgs","repos_url":"https://api.github.com/users/montanaflynn/repos","events_url":"https://api.github.com/users/montanaflynn/events{/privacy}","received_events_url":"https://api.github.com/users/montanaflynn/received_events","type":"User","site_admin":false},"repo":{"id":33098594,"name":"shields","full_name":"montanaflynn/shields","owner":{"login":"montanaflynn","id":24260,"avatar_url":"https://avatars.githubusercontent.com/u/24260?v=3","gravatar_id":"","url":"https://api.github.com/users/montanaflynn","html_url":"https://github.com/montanaflynn","followers_url":"https://api.github.com/users/montanaflynn/followers","following_url":"https://api.github.com/users/montanaflynn/following{/other_user}","gists_url":"https://api.github.com/users/montanaflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/montanaflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montanaflynn/subscriptions","organizations_url":"https://api.github.com/users/montanaflynn/orgs","repos_url":"https://api.github.com/users/montanaflynn/repos","events_url":"https://api.github.com/users/montanaflynn/events{/privacy}","received_events_url":"https://api.github.com/users/montanaflynn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/montanaflynn/shields","description":"Shields badge specification, website and default API server","fork":true,"url":"https://api.github.com/repos/montanaflynn/shields","forks_url":"https://api.github.com/repos/montanaflynn/shields/forks","keys_url":"https://api.github.com/repos/montanaflynn/shields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/montanaflynn/shields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/montanaflynn/shields/teams","hooks_url":"https://api.github.com/repos/montanaflynn/shields/hooks","issue_events_url":"https://api.github.com/repos/montanaflynn/shields/issues/events{/number}","events_url":"https://api.github.com/repos/montanaflynn/shields/events","assignees_url":"https://api.github.com/repos/montanaflynn/shields/assignees{/user}","branches_url":"https://api.github.com/repos/montanaflynn/shields/branches{/branch}","tags_url":"https://api.github.com/repos/montanaflynn/shields/tags","blobs_url":"https://api.github.com/repos/montanaflynn/shields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/montanaflynn/shields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/montanaflynn/shields/git/refs{/sha}","trees_url":"https://api.github.com/repos/montanaflynn/shields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/montanaflynn/shields/statuses/{sha}","languages_url":"https://api.github.com/repos/montanaflynn/shields/languages","stargazers_url":"https://api.github.com/repos/montanaflynn/shields/stargazers","contributors_url":"https://api.github.com/repos/montanaflynn/shields/contributors","subscribers_url":"https://api.github.com/repos/montanaflynn/shields/subscribers","subscription_url":"https://api.github.com/repos/montanaflynn/shields/subscription","commits_url":"https://api.github.com/repos/montanaflynn/shields/commits{/sha}","git_commits_url":"https://api.github.com/repos/montanaflynn/shields/git/commits{/sha}","comments_url":"https://api.github.com/repos/montanaflynn/shields/comments{/number}","issue_comment_url":"https://api.github.com/repos/montanaflynn/shields/issues/comments{/number}","contents_url":"https://api.github.com/repos/montanaflynn/shields/contents/{+path}","compare_url":"https://api.github.com/repos/montanaflynn/shields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/montanaflynn/shields/merges","archive_url":"https://api.github.com/repos/montanaflynn/shields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/montanaflynn/shields/downloads","issues_url":"https://api.github.com/repos/montanaflynn/shields/issues{/number}","pulls_url":"https://api.github.com/repos/montanaflynn/shields/pulls{/number}","milestones_url":"https://api.github.com/repos/montanaflynn/shields/milestones{/number}","notifications_url":"https://api.github.com/repos/montanaflynn/shields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/montanaflynn/shields/labels{/name}","releases_url":"https://api.github.com/repos/montanaflynn/shields/releases{/id}","created_at":"2015-03-30T02:14:04Z","updated_at":"2015-04-04T04:34:57Z","pushed_at":"2015-05-13T08:11:37Z","git_url":"git://github.com/montanaflynn/shields.git","ssh_url":"git@github.com:montanaflynn/shields.git","clone_url":"https://github.com/montanaflynn/shields.git","svn_url":"https://github.com/montanaflynn/shields","homepage":"http://shields.io","size":2794,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"badges:master","ref":"master","sha":"a6563d2968b33d98b23e2a5c136a1d588cd0a7d6","user":{"login":"badges","id":6254238,"avatar_url":"https://avatars.githubusercontent.com/u/6254238?v=3","gravatar_id":"","url":"https://api.github.com/users/badges","html_url":"https://github.com/badges","followers_url":"https://api.github.com/users/badges/followers","following_url":"https://api.github.com/users/badges/following{/other_user}","gists_url":"https://api.github.com/users/badges/gists{/gist_id}","starred_url":"https://api.github.com/users/badges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badges/subscriptions","organizations_url":"https://api.github.com/users/badges/orgs","repos_url":"https://api.github.com/users/badges/repos","events_url":"https://api.github.com/users/badges/events{/privacy}","received_events_url":"https://api.github.com/users/badges/received_events","type":"Organization","site_admin":false},"repo":{"id":7910045,"name":"shields","full_name":"badges/shields","owner":{"login":"badges","id":6254238,"avatar_url":"https://avatars.githubusercontent.com/u/6254238?v=3","gravatar_id":"","url":"https://api.github.com/users/badges","html_url":"https://github.com/badges","followers_url":"https://api.github.com/users/badges/followers","following_url":"https://api.github.com/users/badges/following{/other_user}","gists_url":"https://api.github.com/users/badges/gists{/gist_id}","starred_url":"https://api.github.com/users/badges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badges/subscriptions","organizations_url":"https://api.github.com/users/badges/orgs","repos_url":"https://api.github.com/users/badges/repos","events_url":"https://api.github.com/users/badges/events{/privacy}","received_events_url":"https://api.github.com/users/badges/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/badges/shields","description":"Shields badge specification, website and default API server","fork":false,"url":"https://api.github.com/repos/badges/shields","forks_url":"https://api.github.com/repos/badges/shields/forks","keys_url":"https://api.github.com/repos/badges/shields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/badges/shields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/badges/shields/teams","hooks_url":"https://api.github.com/repos/badges/shields/hooks","issue_events_url":"https://api.github.com/repos/badges/shields/issues/events{/number}","events_url":"https://api.github.com/repos/badges/shields/events","assignees_url":"https://api.github.com/repos/badges/shields/assignees{/user}","branches_url":"https://api.github.com/repos/badges/shields/branches{/branch}","tags_url":"https://api.github.com/repos/badges/shields/tags","blobs_url":"https://api.github.com/repos/badges/shields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/badges/shields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/badges/shields/git/refs{/sha}","trees_url":"https://api.github.com/repos/badges/shields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/badges/shields/statuses/{sha}","languages_url":"https://api.github.com/repos/badges/shields/languages","stargazers_url":"https://api.github.com/repos/badges/shields/stargazers","contributors_url":"https://api.github.com/repos/badges/shields/contributors","subscribers_url":"https://api.github.com/repos/badges/shields/subscribers","subscription_url":"https://api.github.com/repos/badges/shields/subscription","commits_url":"https://api.github.com/repos/badges/shields/commits{/sha}","git_commits_url":"https://api.github.com/repos/badges/shields/git/commits{/sha}","comments_url":"https://api.github.com/repos/badges/shields/comments{/number}","issue_comment_url":"https://api.github.com/repos/badges/shields/issues/comments{/number}","contents_url":"https://api.github.com/repos/badges/shields/contents/{+path}","compare_url":"https://api.github.com/repos/badges/shields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/badges/shields/merges","archive_url":"https://api.github.com/repos/badges/shields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/badges/shields/downloads","issues_url":"https://api.github.com/repos/badges/shields/issues{/number}","pulls_url":"https://api.github.com/repos/badges/shields/pulls{/number}","milestones_url":"https://api.github.com/repos/badges/shields/milestones{/number}","notifications_url":"https://api.github.com/repos/badges/shields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/badges/shields/labels{/name}","releases_url":"https://api.github.com/repos/badges/shields/releases{/id}","created_at":"2013-01-30T07:41:54Z","updated_at":"2015-05-13T03:23:17Z","pushed_at":"2015-05-13T08:11:37Z","git_url":"git://github.com/badges/shields.git","ssh_url":"git@github.com:badges/shields.git","clone_url":"https://github.com/badges/shields.git","svn_url":"https://github.com/badges/shields","homepage":"http://shields.io","size":6371,"stargazers_count":1545,"watchers_count":1545,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":216,"mirror_url":null,"open_issues_count":69,"forks":216,"open_issues":69,"watchers":1545,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/badges/shields/pulls/417"},"html":{"href":"https://github.com/badges/shields/pull/417"},"issue":{"href":"https://api.github.com/repos/badges/shields/issues/417"},"comments":{"href":"https://api.github.com/repos/badges/shields/issues/417/comments"},"review_comments":{"href":"https://api.github.com/repos/badges/shields/pulls/417/comments"},"review_comment":{"href":"https://api.github.com/repos/badges/shields/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/badges/shields/pulls/417/commits"},"statuses":{"href":"https://api.github.com/repos/badges/shields/statuses/ee99fb87abdf5b74634d10b02a57ba9d0e089450"}}}}