Django Implementation : https://github.com/pawangeek/Tweetie2
- Project
- Fetch you Home Timeline Tweets from Twitter Account
- Twitter Social Login
- Able to analyze the tweets having links in the text area and user who share maximum number of tweets having links
- BACKEND
- Using Flask for storing sessions and doing analysis part
- Authlib for Twitter oauth authorization
- FRONTEND
- Flask defaults Jinja2 Templating Engine
- Bootstrap, Jquery for some styling
- BACKEND
- FRONTEND - [JQuery](https://code.jquery.com/) - [Bootstrap 4.5](https://getbootstrap.com/docs/4.5/getting-started/download/)
- Database - [Heroky Postgres](https://www.heroku.com/postgres) - [SQLAlchemy (As ORM)](https://www.sqlalchemy.org/)
- Deploy - [Heroku](https://dashboard.heroku.com/)
.
├── static
│ └── imgs
│ ├── icon
│ └── twitter
├── templates
│ ├── about.html
│ ├── analyze.html
│ ├── base.html
│ ├── error.html
│ ├── index.html
│ └── tweets.html
├── app.py
├── config.py
├── Procfile
├── README.md
└── requirements.txt
- Step 1: Clone the Project
git clone https://github.com/pawangeek/Tweetie
cd Tweetie
- Step 2: Create a virtual environment
# For mac and linux users
python3 -m venv env
source env/bin/activate
# For window users
py -m venv env
.\env\Scripts\activate
- Step 3: Load all dependencies from requirements.txt
pip install -r requirement.txt
- Step 4: Create a project at Heroku and link that in your local enviroment
-> Go to https://dashboard.heroku.com/apps and create a new project
-> Login from remote by heroku login
-> COnnect remote to this app
- Step 5: Create a postgres database from Heroku to deploy
Go to https://data.heroku.com/ select heroku postgres
Bind you recently create app and get the url for database
-
Step 6: Put the postgres database link into into app.config['SQLALCHEMY_DATABASE_URI'] in app
-
Step 7: Open Python terminal and create database tables like this
from app import db
db.create_all()
- Step 8: Go to twitter developer console
Add callback url : http://127.0.0.1:5000/auth
Another callback url http://[your-webapp]-herokuapp.com/auth
- Step 9: Get the twitter_client_id and twitter_client_secret from that twitter dev console
# Add them here
TWITTER_CLIENT_ID = ''
TWITTER_CLIENT_SECRET = ''
- Step 10 Now deploy it to heroku
git init .
git commit -am "Make it awesome"
git origin heroku master
- Step 11 Boom you will see you this app running on website/ localhost.