Giter Site home page Giter Site logo

Comments (6)

rhiever avatar rhiever commented on September 8, 2024

My hacky solution has always been to make multiple copies of the bot, but of course that's horrendous from a software dev perspective. :-) Thankfully I've never run it for more than a few accounts at a time.

The first solution that comes to mind is to put the authentication code into an authenticate() function that takes a file name with the configuration information. That way, the same file could be used to act on multiple accounts. Then the typical use case would be:

  1. Make sure your authentication info is in a file (authentication.txt or whatever)

  2. Import the library

  3. Call the library authenticate() function, pointing it to authentication.txt

  4. Call other functions as you please

from twitterfollowbot.

pkayfire avatar pkayfire commented on September 8, 2024

Would this be something people would want implemented? My only worry is that it might make setup a bit more complicated for first-time users which might deter them from using it. Probably makes sense to tag this as an enhancement for now? I would probably have time to work on it soon if needed.

from twitterfollowbot.

rhiever avatar rhiever commented on September 8, 2024

I think it'd be a nice feature to have. If it's implemented right, the only extra step would be to call the authenticate() function pointing to authentication.txt. The bonus of implementing it this way is that new users would only have to edit the authentication.txt file and would never have to edit the main Python file, so updating the bot would be much easier (i.e., it wouldn't overwrite their authentication information).

from twitterfollowbot.

ydaniels avatar ydaniels commented on September 8, 2024

Actually you don't need any authentication.txt Twitter does not support basic auth to its api anymore so you can't use your password and username to make request .I have edited the code to support multiple accounts but I stopped using it.
What the new user would have to do is anytime they want to add an account they would implement a oauth flow request to Twitter with their consumer keys and Twitter would send a auth url which the user would open in their browser and login and authorize the app. Twitter would now redirect them to their redirect url which they can get thier token verifier in exchange for their tokens which can be stored, so anytime you need to perform an action just load the tokens for the particular account that's all but the consumer key remains the Same . Very simple everything can be automated.

from twitterfollowbot.

kylepierce avatar kylepierce commented on September 8, 2024

In my twitter_info.py file I just have have my two account's info. I comment out the one I am not using and leave the other one readable. It has worked for me. I think you could do it for multiple accounts.

from twitterfollowbot.

rhiever avatar rhiever commented on September 8, 2024

I just committed a major change to the repo that now allows the bot to support multiple accounts through the use of separate config files.

from twitterfollowbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.