A Twitter bot that tweets a gif of a capybara every 24 hours.
Twitter: @capyenjoyerbot
The bot is written in Python and uses the Tweepy library to interact with the Twitter API. The bot extracts a random GIF with the hashtag " capybaras" from Giphy and tweets it/messages it to every follower every 24 hours.
-
Clone the repository
-
Create a virtual environment and install the dependencies fromn the requirements.txt file
pip install -r requirements.txt
-
Create a Twitter developer account and create a new app here
-
Generate the necessery keys and tokens for the app
-
Apply for elevated access to the Twitter API
-
Create a Giphy developer account and create a new app here
-
Generate the GIPHY SDK key for the app
-
Create a .env file with the following environment variables
API_KEY="your_api_key"
API_SECRET_KEY="your_api_secret_key"
ACCESS="your_access_token"
ACCESS_SECRET="your_access_secret_token"
GIPHY_KEY="your_giphy_key"
-
Run the main.py file
python main.py
The bot is automated using GitHub Actions. The workflow is triggered every time a commit is pushed to the repository or at 9AM everyday.