Created
June 20, 2012 12:31
-
-
Save bicherele/2959675 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 util = require('util'), | |
exec = require('child_process').exec, | |
rest = require('restler'); | |
var alertMe = function(){ | |
exec('say -v Cellos Bobby, come get your nodejitsu beta'); | |
}; | |
var checkSite = function(){ | |
util.puts('checking if I can get you into the beta yet.'); | |
rest.get('http://activate.nodejitsu.com/').on('complete', function(result){ | |
if(result instanceof Error) { | |
util.puts('Error: ' + result.message); | |
} else { | |
if(result.indexOf('We\'ve hit our limit today. Please try again later.') < 0) | |
alertMe(); | |
else | |
util.puts('damn it...'); | |
} | |
}); | |
}; | |
var pollingSite = setInterval(checkSite, 10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment