Code behind @labib_likes, a twitter bot that retweets my main's @aka_labib twitter account likes
- Fork the repository.
- Pull it to your desktop.
- Create a
.env
file which contain only the following
export API_KEY='Your API Key'
export API_SECRET='Your API Secret'
export ACCESS_TOKEN='Your Access Token'
export ACCESS_SECRET='Your Access Secret'
- Create a
.gitignore
file which contain only.env
on one line. so that your keys stay safe. - Decide who you want to retweet and edit it in instead of
'aka_labib'
inretweet_bot.py
- Download
pyenv
to setup developer environment for python with adequate dependeancies.
pyenv install 3.11.1
# can try other python versions if you are looking here too far in the future.
# pyenv does lose support sometimes for some versions as they get old
#make sure you are inside at root of this repository in your local before running next line
pyenv shell 3.11.1
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python retweet_bot.py
# Your bot account now should have retweeted the given username's likes
deactivate # to exit environment
#if you want to repeat for retweeting new likes you run:
source venv/bin/activate
python retweet_bot.py
deactivate # to exit environment
You can have the bot deployed on aws or render if you want it to periodically run using cronjobs. I am running it on my machine using crontab. Fairly easy.