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

Invalid or expired token. #83

Closed Loaft closed 8 years ago

Loaft commented 8 years ago

I can follow and sync but when I run 'my_bot.auto_unfollow_nonfollowers()' it unfollows 1 user, and crashes. When i go to check my access tokens it seems they are revoked, and i have to re-create them. Anyone know why this is happening? I understand it might be a Twitter API problem, not sure why its happening only on unfollowing however.

rhiever commented 8 years ago

If you regularly find yourself hitting the Twitter API limit, that's probably why.

Generally, Twitter is against automating follows, favs, and unfollows through the API, which is also why they revoke API access sometimes. Why they're against it yet provide the ability to do it through the API is confusing to me...

On Tue, Sep 29, 2015 at 11:43 AM, Loaft notifications@github.com wrote:

I can follow and sync but when I run 'my_bot.auto_unfollow_nonfollowers()' it unfollows 1 user, and crashes. When i go to check my access tokens it seems they are revoked, and i have to re-create them. Anyone know why this is happening? I understand it might be a Twitter API problem, not sure why its happening only on unfollowing however.

— Reply to this email directly or view it on GitHub https://github.com/rhiever/TwitterFollowBot/issues/83.

Randal S. Olson, Ph.D. Postdoctoral Researcher, Institute for Biomedical Informatics University of Pennsylvania

E-mail: rso@randalolson.com | Twitter: @randal_olson https://twitter.com/randal_olson http://www.randalolson.com

Loaft commented 8 years ago

Thanks for the fast reply, what do you suggest i do? Should I delete and make a new app or give it some time? I've also recently changed my app name and started using the 'post' function, not sure if it has something to do with it, but it seems too coincidental as i've been using ur script for a few months now.

rhiever commented 8 years ago

If they're shutting your bot town for following, faving, or unfollowing, then you're probably SOL and should only use the bot to do actions other than those three.

On Tue, Sep 29, 2015 at 11:53 AM, Loaft notifications@github.com wrote:

Thanks for the fast reply, what do you suggest i do? Should I delete and make a new app or give it some time? I've also recently changed my app name and started using the 'post' function, not sure if it has something to do with it, but it seems too coincidental as i've been using ur script for a few months now.

— Reply to this email directly or view it on GitHub https://github.com/rhiever/TwitterFollowBot/issues/83#issuecomment-144101543 .

Randal S. Olson, Ph.D. Postdoctoral Researcher, Institute for Biomedical Informatics University of Pennsylvania

E-mail: rso@randalolson.com | Twitter: @randal_olson https://twitter.com/randal_olson http://www.randalolson.com

Loaft commented 8 years ago

It's just very weird that they would still allow me to follow 100+ accounts every 10 minutes or so. Thanks for the help, ill comment if anything changes.

rl421403 commented 8 years ago

Twitter allow certain number of requests in 15 mins window. If you are following 100+ accounts every 15 mins, no wonder you are hitting rate limit very often. Be careful, if you are hitting rate limit very ofter then they will suspend/block you app as well as associated account.

The best solution is to divide your actions into many different apps. May be create 5-10 apps and use them for different actions.

For example I use 2 apps for auto fav, 3 apps for auto follow and unfollow. And 1 app for auto tweet.