The back-end for a mood light that expresses the mood of the internet!
- python3
- Ensure you have python3 on your computer by running
python3
in the shell. It should give you a command prompt that you can quit withctrl+D
- Ensure you have python3 on your computer by running
- Github Desktop
- Makes git super easy
- postman
- Tests the API
- ngrok
- Exposes the server to the public
- [Twitter sentiment analysis using Python and NLTK] (http://www.laurentluce.com/posts/twitter-sentiment-analysis-using-python-and-nltk/)
- [Flask Documentation] (http://flask.pocoo.org/docs/0.12/)
- [main.py] (https://github.com/rgerd/YaleRoboticsMoodLight/blob/master/main.py)
- [Makefile] (https://github.com/rgerd/YaleRoboticsMoodLight/blob/master/Makefile)
- [test (command script)] (https://github.com/rgerd/YaleRoboticsMoodLight/blob/master/test)
- [Everything in util] (https://github.com/rgerd/YaleRoboticsMoodLight/tree/master/util)
- Clone the repository to your computer
- Add the confidential twitterconfig.py file to the config folder
- Open up the shell, and navigate to the folder you just cloned
- In the shell, run
make installation
(this installs all requirements for the server code to run)- This will trigger a change in the
test
file because the Makefile adds a line to the top pointing to your python 3 interpreter. This change will automatically be discarded by the.gitignore
file.
- This will trigger a change in the
- To run the server, either run
make server
orFLASK_APP=main.py flask run
- Now navigate to localhost:5000 to see the index page!
- To test a specific function, run
./test
with one oftwitter
emotion
orcolor
- For example,
./test emotion
will run thegetEmotion
function in/util/emotion.py
with the data inexample_tweets.py
- For example,