A twitter bot for whatsapp built using python, tweepy and twilio
- Clone this repo to your local machine using
https://github.com/Aayush-Shukla/WhaTweet
- Edit the utils.py with your TWITTER CONSUMER KEY, SECRET and POSTGRES DATABASE URI.
CONSUMER_KEY = 't5qZhGyVwTkNArktAPM64nSvl'
CONSUMER_SECRET = 'lk2ViVadYV6JbyeY7KLRfcDSxV9aGdn9ez9pTTO8cylnO7Z16J'
DATABASE= 'postgres://xdqieazjvunfne:95c006314ec65cb73f0c7895ef905c64b6606932a7d13cbcab22cb7bdf7a0c0d@ec2-3-216-129-140.compute-1.amazonaws.com:5432/d3hdstc8500olp'
Run the following commands in your terminal (in your SERVER/BACKEND repo):
heroku --version
If it gives you a version, it means that the Heroku CLI interface is correctly installed.
If not, create an account in Heroku (https://signup.heroku.com/) and repeat.
Once you have Heroku installed, run this command in your terminal to login:
heroku login
Type 'enter' or any key and you will be redirected to a browser window where you'll be able to login to your Heroku account.
- Give a name to your app (will be used as a url to your deployed app, so choose something meaningful)
- Choose region: 'Europe'
- Click on "Create" You'll get to the application panel of your app: https://dashboard.heroku.com/apps/{NAME-OF-YOUR-APP-HERE}/deploy/heroku-git
In the root folder of your SERVER/BACKEND repo, run the following command to add heroku remote (connect your local server repo to your app on heroku):
$ heroku git:remote -a name-of-the-app
You will find that command under the "Create a new Git repository" section in your dashboard)
Check that the remote has been correctly added to your project.
You should see a new remote 'heroku' in addition to 'origin' (Github):
$ git remote -v
First, commit your last changes on 'master' branch and push them to Github. On the master branch of your SERVER/BACKEND repo:
$ git add .
$ git commit -m 'Add last changes'
$ git push origin master
then deploy them as well to Heroku pushing them to your 'heroku' remote:
$ git push heroku master
- To get started with WhatsApp, we need to first activate our Twilio Sandbox for WhatsApp. Once you have created a new Programmable SMS project, from the dashboard, select Programmable SMS then select WhatsApp. You will be prompted to activate your sandbox.
- After following the instructions, you should get a message similar to this one on WhatsApp:
- Copy that URL of your Heroku App and paste the URL into the WHEN A MESSAGE COMES IN input box of the sandbox configuration page:
-
Login and logout
-
Makes Tweet along with images and videos
-
Tweets greater than 280 characters are automatically broken into smaller tweets
-
Can update user's profile picture
-
Get trending twitter hastags
-
Shows user's recent tweets and replies
-
Can follow and unfollow users
-
Send/Receive Direct Messages
Copyright © 2020, Ayush Shukla. Released under the MIT license.