-
-
Save tanepiper/7759d14b58963e46fe2e to your computer and use it in GitHub Desktop.
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
getMentions: function(options, cb) { | |
var process_tweet = require('./processors/tweet')(instance); | |
_.defaults(options, { | |
include_entities: true, | |
include_rts: true | |
}); | |
twitter.getMentions(options, function(err, tweets) { | |
if (err) { | |
return cb(err); | |
} | |
var new_tweets = []; | |
function done() { | |
cb(null, new_tweets); | |
} | |
process_tweet.on('data', function(data) { | |
new_tweets.push(data); | |
}); | |
process_tweet.on('error', function(error) { | |
cb(error); | |
}); | |
tweets.forEach(function(tweet) { | |
process_tweet.write(tweet); | |
}); | |
done(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment