Last active
December 21, 2015 03:29
-
-
Save joshvermaire/6242491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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