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

Need to handle Twitter rate limitations within code. #111

Open
robertIanClarkson opened this issue Jun 14, 2021 · 1 comment
Open

Need to handle Twitter rate limitations within code. #111

robertIanClarkson opened this issue Jun 14, 2021 · 1 comment

Comments

@robertIanClarkson
Copy link
Contributor

Twitter allows 300 POSTS per 3 hours (~1.6 tweets per minute). We need to keep track of this so we don't handle mentions, and then fail to post because we have exceeded the limit. Ideally, we would not write to last_seen_id.txt so that if the limit is met, mentions will still be responded to once the tally is reset.

My possibly suggestions:

  • Tally sent tweets and prohibit use if cap is met
while True:
    if postLimitNotMet():
        reply_to_tweets()
    time.sleep(15)
  • Only allow a certain number of ISBNs per tweet, I suggest just 1 for now. If, we have a 1 mention = 1 response behavior then I believe the bot would be less likely to be overloaded.

A side note: While unlikely, there could be an instance when borrowbot is maliciously spammed. It would be nice to have something that prevents such an action.

@robertIanClarkson
Copy link
Contributor Author

@mekarpeles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant