Skip to content

Instantly share code, notes, and snippets.

@todbot
Last active September 3, 2016 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todbot/b7d6b2dbc380ea7398a3eb2d554db47c to your computer and use it in GitHub Desktop.
Save todbot/b7d6b2dbc380ea7398a3eb2d554db47c to your computer and use it in GitHub Desktop.
Excerpt from twitter-streaming-blink1
// Listen for favorite events
user_stream.on('favorite', function (eventMsg) {
if (eventMsg.target.screen_name = screen_name) {
console.log('@' + eventMsg.source.screen_name + ' has favorited a Tweet.');
blinkFavorite();
}
});
// Listen for follow events
user_stream.on('follow', function (eventMsg) {
if (eventMsg.target.screen_name = screen_name) {
console.log('@' + eventMsg.source.screen_name + ' is a now a follower.');
blinkFollow();
}
});
// Listen for mention events
filter_stream.on('tweet', function (tweet) {
console.log('@' + tweet.user.screen_name + ' Tweeted with a mention.');
blinkMention();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment