Last active
September 3, 2016 17:28
-
-
Save todbot/b7d6b2dbc380ea7398a3eb2d554db47c to your computer and use it in GitHub Desktop.
Excerpt from twitter-streaming-blink1
This file contains 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
// 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