Instantly share code, notes, and snippets.

Embed
What would you like to do?
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