Powersocket
A tiny library for connecting to Gnip Powertrack streams.
Usage
There are two ways to configure PowerSocket:
Provide three separate User, Password, and Path (just the path section of your PT url) arguments, and a callback for when a tweet arrives:
var powerSocket = ; username: processenvPOWERSOCKET_USER password: processenvPOWERSOCKET_PASS path: processenvPOWERSOCKET_PATH1 onTweet: onTweet; io.sockets.emit('tweet', tweet);}
Or, just provide a full URL that includes your PT username and password, and a callback:
var powerSocket = ; url: processenvPOWERSOCKET_URL onTweet: onTweet; io.sockets.emit('tweet', tweet);}
Your callback will be triggered whenever a new tweet arrives. An error will be raised on any error in the HTTP client.