This is a tiny Python script that replies to specified number of tweets containing a specified hashtag.
This Twitter bot uses Tweepy, a Python module to deal with the Twitter API.
Successfully tested and ran with Python38, running on Windows 11.
Run as a cron job or via Task Scheduler to automatically reply to certain tweets of your interest.
Added functioanlity to use random tweet for reply from a text file. Now, you can define the tweets in "tweets.txt" file and start the bot. Also prevents replyign to same tweet again and again. Works with Tweepy v4.
Add a GUI for simplicity.....
- Open Terminal or Command Prompt(cmd.exe) or PowerShell. Make sure
git
is installed. git clone https://github.com/Suleman-Elahi/TwitterAutoReplyBot && cd TwitterAutoReplyBot
pip3 install tweepy
- Enter the Twitter keys in
bot.py
file at lines 7-10. - Customize the hashtag, number of tweets to reply to, and tweets type to fetch at line 11-13 of "bot.py".
- Define the tweets in each line of the text file,
tweets.txt
. - Run as:
python bot.py
orpython3 bot.py