DEV Community

Discussion on: Sentiment analysis on Trump's tweets using Python 🐍

Collapse
 
sanjay555 profile image
Sanjayshr

How do I take this to Cloud? flask + Heroku ??. Thanx in ADVANCE !!

Collapse
 
rodolfoferro profile image
Rodolfo Ferro

Sorry for taking so long.

There are mainly two approaches:

  1. Consume as a Rest API. In that case, the deployment in Heroku (or any other deployment service) would have to process the new tweets and add the new data to the previous.
  2. Create a stream listener to continuously detect a new tweet and process it.

In 1., the simplest way would be only to schedule a task (a simple script) to be executed on certain time (pythonanywhere also works for this, I have a twitter bot that runs every 24 hours). Anyway one can create a service using Tweepy, in fact there's a Flask-Tweepy integration: flask-tweepy.readthedocs.io/en/lat...

Collapse
 
sanjay555 profile image
Sanjayshr • Edited

Thank you.