Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shields for Uptime Robot #947

Merged
merged 8 commits into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -932,12 +932,12 @@ <h3 id="miscellaneous"> Miscellaneous </h3>
<td><code>https://img.shields.io/swagger/valid/2.0/https/bitbucket.org/api/swagger.json.svg</code></td>
</tr>
<tr><th> Uptime Robot status: </th>
<td><img src='https://img.shields.io/uptimerobot/status/u956-afus321g565fghr519.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/status/u956-afus321g565fghr519.svg</code></td>
<td><img src='https://img.shields.io/uptimerobot/status/m778918918-3e92c097147760ee39d02d36.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/status/m778918918-3e92c097147760ee39d02d36.svg</code></td>
</tr>
<tr><th> Uptime Robot ratio (30 days): </th>
<td><img src='https://img.shields.io/uptimerobot/ratio/u956-afus321g565fghr519/30.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/ratio/u956-afus321g565fghr519/30.svg</code></td>
<td><img src='https://img.shields.io/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36/30.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36/30.svg</code></td>
</tr>
</tbody></table>

Expand Down
12 changes: 12 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6046,6 +6046,12 @@ cache(function(data, match, sendBadge, request) {
},
uri: 'https://api.uptimerobot.com/v2/getMonitors'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include a link to the API docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};
// A monitor API key must start with "m"
if (monitorApiKey.substring(0, "m".length) !== "m") {
badgeData.text[1] = 'api_key invalid';
sendBadge(format, badgeData);
return;
}
request(options, function(err, res, json) {
if (err !== null || res.statusCode >= 500 || typeof json !== 'object') {
badgeData.text[1] = 'inaccessible';
Expand Down Expand Up @@ -6108,6 +6114,12 @@ cache(function(data, match, sendBadge, request) {
},
uri: 'https://api.uptimerobot.com/v2/getMonitors'
};
// A monitor API key must start with "m"
if (monitorApiKey.substring(0, "m".length) !== "m") {
badgeData.text[1] = 'api_key invalid';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change.

Would 'must use a monitor key' be more helpful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done a0e1afb

sendBadge(format, badgeData);
return;
}
request(options, function(err, res, json) {
if (err !== null) {
badgeData.text[1] = 'inaccessible';
Expand Down
8 changes: 4 additions & 4 deletions try.html
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,12 @@ <h3 id="miscellaneous"> Miscellaneous </h3>
<td><code>https://img.shields.io/swagger/valid/2.0/https/bitbucket.org/api/swagger.json.svg</code></td>
</tr>
<tr><th> Uptime Robot status: </th>
<td><img src='/uptimerobot/status/u956-afus321g565fghr519.svg' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/status/u956-afus321g565fghr519.svg</code></td>
<td><img src='/uptimerobot/status/m778918918-3e92c097147760ee39d02d36.svg' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/status/m778918918-3e92c097147760ee39d02d36.svg</code></td>
</tr>
<tr><th> Uptime Robot ratio (30 days): </th>
<td><img src='/uptimerobot/ratio/u956-afus321g565fghr519/30.svg' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/ratio/u956-afus321g565fghr519/30.svg</code></td>
<td><img src='/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36/30.svg' alt=''/></td>
<td><code>https://img.shields.io/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36/30.svg</code></td>
</tr>
</tbody></table>

Expand Down