agora-bridge icon indicating copy to clipboard operation
agora-bridge copied to clipboard

enhancement - use twitter streaming API

Open sneakers-the-rat opened this issue 2 years ago • 0 comments

Hello hello - recall you saying the twitter bot is slow to respond, and noticed you were using a polling strategy:

https://github.com/flancian/agora-bridge/blob/9cfe0a41e55bba4f628875ecf0c8fefd3ad509fd/bots/twitter/agora-bot.py#L882

and wondering if you've tried the streaming API? there are limits to how long the filtering rules can be, but from what i'm reading you can just open up more streams (25 per 15 minutes https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/introduction ). I've found this to be pretty snappy, and would avoid having to parse all tweets in the home timeline if you added a rule like ("[[" AND "]]") OR "#") to each of the streams.

also happy to draft a PR for this if you'd like :)

sneakers-the-rat avatar Oct 06 '22 21:10 sneakers-the-rat