A simple Twitter bot to help block users more efficiently
Ensure you have Python 3 installed on your device, as well as MySQL.
- Git clone this repo
- Obtain consumer key and secret from the Twitter Developer portal. The app should be configured to enable Sign in with Twitter:
cd twitter-app
.- On your local setup, create an
.env
and Set env variables:
APP_NAME
APP_URL
APP_CONSUMER_KEY
APP_CONSUMER_SECRET
APP_ACCESS_TOKEN
APP_ACCESS_TOKEN_SECRET
DB_HOST
DB_NAME
DB_USER
DB_PASSWORD
- Create database
- Setup a pipenv environment, and install dependencies:
virtualenv twitter-app
source ../twitter-app/bin/activate
on mac or../twitter-app/bin/activate
windowspip install -r requirements.txt
- Start the app:
python app.py
; orgunicorn app:app
Note: A
Procfile
is included for deployment to cloud solutions.
Finally, revisit the dev portal, and add your app's callback URL (https://your-deployed-url/callback e.g http://127.0.0.1:8000/callback
) to the callback URL whitelist setting. Once saved, follow the instructions on the app's web UI to click through the demo pages.
Twitter Developer Portal
Flask
python-oauth2
Bootstrap
Original version by Zacchaeus Bolaji
- Fork the project
- Pull to your local device
- Make your changes and push
- Create a Pull Request using this template