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 throttle back if rate-limited #1

Open
coreyhaines opened this issue Sep 29, 2011 · 3 comments
Open

Need to throttle back if rate-limited #1

coreyhaines opened this issue Sep 29, 2011 · 3 comments

Comments

@coreyhaines
Copy link
Owner

When twitter rate limits the bot, need to stop attempting for a while. Either pause for a pre-determined time, or check whether rate-limited each time trying to post.

@baroquebobcat
Copy link

The number of requests you have left comes back as a header in each api request.

https://dev.twitter.com/docs/rate-limiting/faq#checking

@baroquebobcat
Copy link

It also includes an epoch time which tells you when the ratelimit resets

from the website's headers

X-RateLimit-Class:api_phoenix
X-RateLimit-Limit:1000
X-RateLimit-Remaining:987
X-RateLimit-Reset:1318980704

a tweet bot will probably have a much lower limit than the website though.

@coreyhaines
Copy link
Owner Author

Awesome, thanks. I hadn't looked too closely at the return. I'll look into adding this. For now, it just stops for an hour, but having a bit more information like this will make it work better.

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

2 participants