Comments (6)
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:
-
Make sure your authentication info is in a file (
authentication.txt
or whatever) -
Import the library
-
Call the library
authenticate()
function, pointing it toauthentication.txt
-
Call other functions as you please
from twitterfollowbot.
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.
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.
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.
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.
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)
- Need help with installation please HOT 1
- auto_unfollow_nonfollowers() crashes for certain suspended user HOT 4
- Why my already-followed.txt is empty HOT 1
- twitterfollowbot 2.0.2 requires twitter==1.17.0, which is not installed. HOT 1
- Erreur de Syntaxe detectées dans les clés API
- probleme lors del'execution du programme python
- How to make the bot auto retweet the latest tweet? HOT 1
- Unfollow only X people that don't follow back?
- FYI - API wrapper methods out-dated; Project non-functional HOT 2
- Hello help me this problem not starting tweet bot
- dear author
- Automatically add users tweeting about something to one of your list
- Help with setting up a Twitter bot HOT 1
- a
- Can't run the bot HOT 2
- i am having this problem with irclib
- TwitterFollowBot
- T
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitterfollowbot.