Skip to content

Aayush-Shukla/WhaTweet

Repository files navigation

WhaTweet

A twitter bot for whatsapp built using python, tweepy and twilio


Table of Contents


Installation

Clone

  • Clone this repo to your local machine using https://github.com/Aayush-Shukla/WhaTweet

Edit utils.py

  • 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'

Heroku Setup

1. SIGNUP/LOGIN TO HEROKU

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.

   

2. CREATE THE APP IN HEROKU

2.1. Go to your dashboard, and click on the top right button that says "New: > 'Create New app'

 

2.2. Connect Heroku to your local repo

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

 

2.3. Deploy your server to Heroku

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

   

Twilio Setup

  • 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:


Features

  • 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


Contribute

Contributors Guide


License

Copyright © 2020, Ayush Shukla. Released under the MIT license.

Releases

No releases published

Packages

No packages published

Languages