Skip to content

Instantly share code, notes, and snippets.

@joshvermaire
Last active December 21, 2015 03:29
Show Gist options
  • Save joshvermaire/6242491 to your computer and use it in GitHub Desktop.
Save joshvermaire/6242491 to your computer and use it in GitHub Desktop.
var request = require('request')
growl = require('growl');
var interval;
var makeRequest = function () {
request.get(
'https://status.github.com/api/status.json',
function (error, response, body) {
var json;
if (!error && response.statusCode == 200) {
json = JSON.parse(body);
if (json.status === 'good') {
growl(
'ITS BACK!', {
image: '/Users/joshvermaire/Desktop/imgres.jpeg',
title: "Github Status",
sticky: true
}
);
clearInterval(interval);
}
}
}
);
}
interval = setInterval(makeRequest, 30000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment