Skip to content

Instantly share code, notes, and snippets.

@BatuhanK
Created September 3, 2014 18:38
Show Gist options
  • Save BatuhanK/e1e0b3205ff8466f4bc5 to your computer and use it in GitHub Desktop.
Save BatuhanK/e1e0b3205ff8466f4bc5 to your computer and use it in GitHub Desktop.
User_id topluyoruz
var Twit = require('twit');
var redis = require('redis'),
client = redis.createClient();
var T = new Twit({
consumer_key : ''
, consumer_secret : ''
, access_token : ''
, access_token_secret : ''
});
var stream = T.stream('statuses/filter', { track: 'a', language: 'tr' })
stream.on('tweet', function (tweet) {
client.sismember(['twitter_id_set', tweet.user.id_str], function(err, reply) {
if(err) console.log(err);
if(reply===0){
client.sadd("twitter_id_set", tweet.user.id_str);
console.log(tweet.user.id_str + " ekleniyor");
} else {
console.log(tweet.user.id_str + " geciliyor var zaten");
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment