A Twitter bot, designed to monitor mentions containing specific hashtags, reply to those tweets, favorite them, and retweet them. The bot is built using the Tweepy library and utilizes Twitter's API.
Built Using -
- Twitter API and OAuth Handler
- Tweepy Module of Python
- Bash Cloud (PythonAnywhere), can run continuously for 24 hours
If you are on Twitter then You can try it out. Don't forget to mention @RooeBot and use hashtags like #codedays #day #consistency It can be used for maintaining consistency in learning where people can share their learning journey every day and the bot will promote it and can also be used for HashTag marketing.
With further modifications,( Using sentiment analysis, and DM features) this can be turned into a bot that can automate Twitter customer management for Commercial Companies.
- Monitors Twitter mentions in real-time.
- Replies to tweets containing the hashtags
#codedays
or#day
. - Favorites and retweets the mentioned tweets.
- Keeps track of the last seen tweet ID to avoid duplicate interactions.
- Python 3.x
- Tweepy library (install using
pip install tweepy
)
- Clone this repository to your local machine.
- Create a Twitter Developer account and set up a new Twitter App to obtain the necessary API keys and tokens.
- Replace the placeholder values in the script with your actual API keys and tokens.
- Customize the reply message as needed.
- Run the script using the command
python twitter_bot.py
.
In the twitter_bot.py
script, make sure to update the following variables with your actual Twitter API credentials:
consumer_key = 'YOUR_CONSUMER_KEY'
consumer_secret = 'YOUR_CONSUMER_SECRET'
key = 'YOUR_ACCESS_TOKEN_KEY'
secret = 'YOUR_ACCESS_TOKEN_SECRET'