var new_uuid = uuid.v4(); var sig = uuid.v4().substring(0, 8); users[new_uuid] = { 'user_id' : new_uuid, 'connected' : new Date(), 'sig' : sig } return users[new_uuid]; } Friday, July 6, 12
//... var random_word = words[Math.floor(Math.random() * words.length)]; callback(null, random_word); // Can put this anywhere in function } async.waterfall([ getRecentTweets, selectWordAtRandom, collectTweetsForGuess, ], function (err, result) { console.log(result); }); Friday, July 6, 12
"<h2>How many times has the word '" + message.data.word + "' been tweeted in the last " + message.data.diff + "?</h2>"; $('#answer').show(); current_game = message.data; var now = +new Date(), time_diff = now - current_game.posed_at; $('#time_left').html("").countdown({ image: 'img/digits.png', startTime: "" + Math.floor((current_game.length - time_diff) / 1000), format: 'ss' }); }); Friday, July 6, 12
Nodejitsu info: It worked if it ends with Nodejitsu ok info: Executing command apps create info: Analyzing your application dependencies in server.js info: Checking app availability tweet-guesser info: Creating app tweet-guesser info: Nodejitsu ok Friday, July 6, 12
new snapshot for version 0.1.0-1 info: Done creating snapshot 0.1.0-1 info: Updating application tweet-guesser info: Activating snapshot 0.1.0-1 for tweet-guesser info: Stopping app tweet-guesser info: App tweet-guesser is now stopped info: Starting app tweet-guesser info: App tweet-guesser is now started info: http://tweet-guesser.nodejitsu.com on Port 80 info: Nodejitsu ok Friday, July 6, 12