ttezel / twit

Twitter API Client for node (REST & Streaming API)
4.31k stars 568 forks source link

T.stream("statuses/filter", { follow: [Multiple User IDs] }) only streams Tweets for some of the IDs #464

Closed cycloptux closed 6 years ago

cycloptux commented 6 years ago

I'm having some hard time even debugging this error.

I have a stream set up to stream tweets that are coming from a few (~10) public accounts. Here's my simple stream: var stream = T.stream("statuses/filter", { follow: user_ids }); user_ids is an array of IDs that I previously fetched from a list of screen_names using T.get("users/show", { screen_name: x });.

Now, when I run the stream, it'll fire an event for tweets that involve some of those IDs, while others are getting "ignored". I can't even find an "error" event to debug what's happening. When I tried splitting the streams (1 ID per stream, multiple streams) I noticed some of the streams (random ones each time, not the same ID every time) wouldn't fire the "connected" event.

Any clue on how to fix (or debug) this behavior?

cycloptux commented 6 years ago

Ok. I finally managed to debug and find the error. I was using the id to discriminate users instead of the id_str. The "new" 64-bit ids weren't being parsed correctly and were ignored. Moving to id_str fixed my issue.

dandv commented 5 years ago

How many IDs have you used? If it's over a few thousand, the library needs to use POST instead of GET.

Edmund1645 commented 5 years ago

Is it possible to use the track and follow params at the same time on status/filter stream?

AditModi commented 4 years ago

@Edmund1645 ,

var stream = T.stream('statuses/filter', { follow: twitter_config.handles , track: twitter_config.topics , language: twitter_config.languages });

I am using above approach but it doesn't seem to work. twitter_config.handles are the user-ids and topics are the keywords.

@cycloptux , is user-ids correct way of referencing for this architecture???

Should I be using screen_name or user-id???

What to do if i have to use few thousand user-ids and a few keywords??