Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweepy stream incomplete read error super high amounts of tweets #1163

Closed
Hunterhusker opened this issue Jan 23, 2019 · 1 comment
Closed
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate Question This is a question

Comments

@Hunterhusker
Copy link

So straight off the bat I would like to reference this problem here #448 I think it is most certainly having a similar issue, but as it is from almost 5 years ago, I thought I would open a new thread to see if anything has changed since 2014 to help me. I am receiving probably the highest amount of tweets that anyone has used this bot for. I am using this bot to track when Donald Trump tweets, and then play America the Beautiful and flash an LED to the song. Lets not get into politics, but if you haven't noticed people like to constantly tweet at him, and so by having my bot follow him I am getting a super huge influx of tweets 24/7, non stop. I have a video somewhere where I printed out the names of the tweeters holy moly, at least 3 a second. Anyway I just want to say this bot is crashing periodically with super large amounts of tweets coming through. It probably wasn't designed for this. Is there anyway to make it only follow tweets made by the user and not tweets at the user, because that would fix a lot of my problems. The specific error is an incomplete read error, I assume from tweets coming and going so fast it cannot be processed. I am filtering them out with a tag and user check function to see what tweets actually make it to my main loop, but I think maybe there is more I can do to keep it running longer.

@Harmon758
Copy link
Member

Is there anyway to make it only follow tweets made by the user and not tweets at the user

In short, no. The only parameter the Twitter API's statuses/filter endpoint has for following a specific user is follow, which:

For each user specified, the stream will contain:

  • Tweets created by the user.
  • Tweets which are retweeted by the user.
  • Replies to any Tweet created by the user.
  • Retweets of any Tweet created by the user.
  • Manual replies, created without pressing a reply button (e.g. @twitterapi I agree).

See https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/basic-stream-parameters.

You'll have to filter out other Tweets yourself.
Otherwise this issue is a duplicate of #237 (and #448).

@Harmon758 Harmon758 added Bug This is regarding a bug with the library Duplicate This is a duplicate Question This is a question labels Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate Question This is a question
Projects
None yet
Development

No branches or pull requests

2 participants