A twitter bot made using Python and Twitter API to retweet posts using specific terms related to the conference and be beneficial to thea social media campaign by keeping all tweets about PyCon India in one place and get the event trending. It could be hastags, twitter handles, slang words. Anything.
- Fork and clone this repository,
git clone <Forked repository URL>
- Run the following command in your terminal, be sure to have Python3 already setup in your system.
pip3 install -r requirements.txt --user
- Go to the https://apps.twitter.com/
- Click the
Create App
button - Fill the necessary details for your application that you are creating
- Name of the bot
- Website name
- Description
- Once created, goto
Keys and Tokens
section and generate your access tokens. - Once located, move on to the next step for configuring scripts/config.py
-
For the bot to run, the Tweepy API needs to be authorised with
consumer_key
,consumer_secret
,access_token
andaccess_token_secret
. These values are listed in scripts/config.py and needs to be filled before the execution ofmain.py
script for connecting to the Twitter API -
searchterms
in config.py are the target terms, the bot checks for these terms constantly, so for example, if the user is searching forPyConIndia2018
so the terms in the list are as follows ["#PyConIndia2018","PyConIndia","@pyconindia","#pyconindia"] -
Add hashtags, specific words, user handles in the
searchterms
. Anything you want retweeted.
- Navigate to the scripts directory and run the bot using the following command
python3 main.py
Use the following commands to host this app in heroku
heroku create
git add .
git commit -m "initial commit"
git push heroku master
heroku ps:scale worker=1
heroku logs --tail
Refer to the Contributing.md for the same. The source code is under MIT License.