rhiever / TwitterFollowBot

A Python bot that automates several actions on Twitter, such as following users and favoriting tweets.
GNU General Public License v3.0
1.31k stars 447 forks source link

auto_follow() randomly stopping. #79

Open Tyler-Darby opened 9 years ago

Tyler-Darby commented 9 years ago

With my recent addition of a counter for the auto_follow() function (See #78), I have noticed that this function stops working after a random amount of follows, regardless of the count argument.

For example,

bot.auto_follow("#lol", count=200)

may stop around 30, 70, 110, 50, or some other random number.

The only reasoning I could think of is there not being enough tweets to fetch, but I disproved this buy trying very common keywords, such as "lol" and "funny".

rhiever commented 9 years ago

The only other reason that the auto_follow method would stop is if you're hitting an API limit error, which seems likely. The Twitter API only allows so many follow actions within a 15 minute period.

rhiever commented 9 years ago

I opened #73 to make better plans for avoiding API rate limits, but have been too busy to get around to implementing it.

rl421403 commented 9 years ago

I think for that. He should set delay of ~45-60 secs. This is what I use

FOLLOW_BACKOFF_MIN_SECONDS:45
FOLLOW_BACKOFF_MAX_SECONDS:60

Works without any problem.

Tyler-Darby commented 9 years ago

The thing is though, with the script i've written, it loops through a dictionary of keywords i've given it, and does a set number of each, so for example if I have 5 keywords and tell it to follow 200 each, it SHOULD follow 200 of the first, 200 of the next, so on...

But it follows about 50, 30, 70, etc, then proceeds to the next one, with no issue. If I was hitting an API limit it wouldn't go on to the next keyword correct?

rhiever commented 8 years ago

Is it possible that there are only 50, 30, 70, etc. tweets matching the keyword you searched? Note that the API will only go back so far (maybe a week?) in the search for tweets.

Tyler-Darby commented 8 years ago

Surely not. I've been using extremely common hashtags, such as #funny, or trending hashtags, to do my searches.