Skip to content

Need to handle Twitter rate limitations within code. #111

@robertIanClarkson

Description

@robertIanClarkson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions