Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created June 24, 2012 14:30
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 tanepiper/7759d14b58963e46fe2e to your computer and use it in GitHub Desktop.
Save tanepiper/7759d14b58963e46fe2e to your computer and use it in GitHub Desktop.
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