Closed premierball23 closed 9 years ago
Place config.txt
wherever you want and pass the path to the TwitterBot constructor, e.g.,
from TwitterFollowBot import TwitterBot
my_bot = TwitterBot(config_file='/path/to/config.txt')
Thank you for your help.
Within the config file, what should I input into:
ALREADY_FOLLOWED_FILE:already-followed.txt FOLLOWERS_FILE:followers.txt FOLLOWS_FILE:following.txt USERS_KEEP_FOLLOWING: # i want to keep following all of my users USERS_KEEP_UNMUTED: # all of the people i follow are unmuted USERS_KEEP_MUTED: # i dont have any muted followers
Basically, what should I input if i don't want any changes?
The top 3 entries should point to the same directory as where you have the config.txt
file so you keep everything in order.
If you want to keep following all of your users, then don't worry about USERS_KEEP_FOLLOWING
and never use the auto_unfollow
functions. Same for the auto_mute
and auto_unmute
functions.
I am fairly new to Python. I appreciate your help and patience. I am new to Python.
I have attached a picture of the error messages I'm receieving. 1) index error 2) index error: index out of range
Here are the contents of the config.txt file:
OAUTH_TOKEN:'myconfig' OAUTH_SECRET:'mysecret' CONSUMER_KEY:'mykey' CONSUMER_SECRET:'myconsecret' TWITTER_HANDLE:'myusername' ALREADY_FOLLOWED_FILE:already-followed.txt FOLLOWERS_FILE:followers.txt FOLLOWS_FILE:following.txt USERS_KEEP_FOLLOWING: USERS_KEEP_UNMUTED: USERS_KEEP_MUTED: FOLLOW_BACKOFF_MIN_SECONDS:10 FOLLOW_BACKOFF_MAX_SECONDS:60
That's really strange - I can't reproduce this on my end. What if you just put 0s in these entries?
USERS_KEEP_FOLLOWING:0 USERS_KEEP_UNMUTED:0 USERS_KEEP_MUTED:0
When i put 0's in the entries, the same error occurs.
Is it possible that I messed something up in the init.py file for TwitterFollowBot? Errors kept coming up when i would enter "from TwitterFollowBot import FollowBot". The errors said "cannot import name Twitter". I looked in the Twitter folder and there wasn't a file called twitter, only twitter_globals. Within the same folder, oath was lower case and there was only a file named error. So I went into the init.py text and put in the following code:
"""from twitter import twitter_globals, oauth, error
the code used to read """from Twitter import Twitter, OAuth, (some long error)
Have you installed the twitter module?
pip install twitter
It's a separate module.
Requirement already satisfied (use --upgrade to upgrade): twitter in c:\users\gus gabel\anaconda\lib\site-packages
Yes, the above statement means that it is installed.Maybe it is the wrong version? The twitter module only has files that reads oath.py, not OAth, and twitter.py, not Twitter.
Do I understand right that you edited the code in __init__.py
? You'll definitely want the code as it was before.
When I revert the init.py code back to the original, the following error message is shown:
ImportError Traceback (most recent call last)
i have attached a screenshot of the contents of the twitter module
Weird - it's acting like the twitter
module isn't installed.
Then it could be my directory path?
Please Help
How do I fix this error? I have the config.txt file in the TwitterFollowBot folder within this directory anaconda>lib>site>site-packages>TwitterFollowBot.
I have already appended this directory into python.
I'm just following the code
from TwitterFollowBot import TwitterBot my_bot = TwitterBot()