Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

jcs-lambda/ds11u3s3-twitoff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived this repo

  • heroku no longer offering free apps
  • basilica no longer a company
  • dependabot alerts

ds11u3s3-twitoff

DS11 Unit 3 Sprint 3 - Twitter Face-Off

See This App Live, on Heroku (NO MORE FREE TIER APPS)

How to use locally

Obtain API keys

AlphaVantage

Basilica (SHUTDOWN)

Twitter

Create file in project root: .env

FLASK_APP='twitoff'
BASILICA_KEY='<your key here>'
ALPHAVANTAGE_KEY='<your key here>'

TWITTER_API_KEY='<your key here>'
TWITTER_API_KEY_SECRET='<your key secret here>'
TWITTER_ACCESS_TOKEN='<your token here>'
TWITTER_ACCESS_TOKEN_SECRET='<your token secret here>'

Enter the virtual environment

pipenv shell

Setup / migrate database

FLASK_APP=twitoff flask db init
FLASK_APP=twitoff flask db migrate
FLASK_APP=twitoff flask db upgrade

Launch app

FLASK_APP=twitoff flask run

How to deploy to heroku

From the shell in your project's virtual environment root

heroku login
heroku create <your-app-name-here>
git push heroku master
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set FLASK_APP='twitoff'
heroku config:set SECRET_KEY='<your key here>'
heroku config:set BASILICA_KEY='<your key here>'
heroku config:set ALPHAVANTAGE_KEY='<your key here>'
heroku config:set TWITTER_API_KEY='<your key here>'
heroku config:set TWITTER_API_KEY_SECRET='<your key here>'
heroku config:set TWITTER_ACCESS_TOKEN='<your key here>'
heroku config:set TWITTER_ACCESS_TOKEN_SECRET='<your key here>'

heroku run /bin/bash
flask db init
flask db stamp head
flask db migrate
flask db upgrade
exit

References

https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/user-object

https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object

http://docs.tweepy.org/en/latest/api.html#api-reference

https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/

https://jinja.palletsprojects.com/en/2.11.x/templates/#list-of-control-structures

https://flask-sqlalchemy.palletsprojects.com/en/2.x/

https://devcenter.heroku.com/articles/heroku-cli