Closed ygalanter closed 6 years ago
Never mind. Was being and idiot and using twitter screen names instead of IDs.
Can you post your code? Still getting this with IDs.
Are you using actual numeric IDs? I usually use services like http://gettwitterid.com/ to get numeric id from a twitter handle.
I managed to fix it by removing a parameter from the function call. It was weird.
I got it working now but it seems to catch tweets where people @ someone as well. Do you know if I can just capture my specific timeline?
Yes you need to filter out mentions (and if you want - retweets too). Here's how I did it (it's designed to track multiple users, but can be used for one too):
// Twitter IDs of tracked users
var users = ['243235235','235923485', '52347345'];
var stream = tw_client.stream('statuses/filter', {follow: users.join(',')});
stream.on('data', function(tweet) {
// if tweet is not originated from tracked user (mention) or retweet - exit
if (!users.find(el => tweet.user.id_str == el && !tweet.retweeted_status)) return;
// continue code
}
Sweet! I managed to do it using this code.
idList.indexOf(tweet.user.id_str) > -1
Since I don't want to catch retweets.
Thank you!
No problem. Glad it worked for you :)
I've seen similar question asked before, but I tried all the recommendations and still no luck. REST API works, streaming works for "track" but returns 401 for "follow". Help!