A python script which retweets tweet with specific hashtags to a twitter account.
- Get the latest tweets using Twitter Stream API
- Re-tweet tweets specific text and hashtags
- Python 3.4.x+
- pip 6.1.1+
- virtualenv 12.1.1+
- tweepy 3.5.0
- First clone the project locally and then go into the directory
git clone https://github.com/MikaSoftware/py-twitter-retweeter.git
cd py-twitter-retweeter
- Setup our environment:
(OSX)
python3 -m venv env
(Linux/FreeBSD)
virtualenv env
- Activate "virtualenv" for this script:
source env/bin/activate
- Confirm we are using Python3
python --version # Should return Python 3.x
- Now let's install the required libraries:
pip3 install -r requirements.txt
-
Bugfix an error with tweepy by reading the instructions here: tweepy/tweepy#615
-
Go to http://apps.twitter.com and create an app. Once finished, be sure to make a copy of the following data:
- Consumer Key
- Consumer Secret
- Access Token
- Access Secret
- Go into the source folder and change the secret_settings.py file by entering the values you saved from step (5).
cp src/secret_settings_example.py src/secret_settings.py
vi src/secret_settings.py
- Replace the values with your Twitter API Keys/Tokens.
To run the application, simply enter the following line:
python retweeterbot.py
BSD
- Bitcoin: 17VEy2fps6nJCUhWsvhJ4h42omWMJZUjcm