Git Product home page Git Product logo

hb-solo-final-project's Introduction

Tweet America

Maps sentiment of the tweets about an specific term in USA locatios. Hackbright Final Project. 100% my code.

Contents

Technologies

Backend: Python, Flask, PostgreSQL, SQLAlchemy
Frontend: JavaScript, jQuery, AJAX, Jinja2, Bootstrap, HTML5, CSS3
APIs: Twitter RestAPI, Google Natural Language, Google Maps, Google Charts

Features

Summary

Tweet America is a mostly backend project. It is an app that shows Tweets with their location and Sentiment. Currently only covers the US. I wrote the server using Python and Flask, and SQLALchemy to talk to the DB.

✨ Pride ✨

My biggest challenge was the calculation of the geolocation of the tweets. To solve this I built a Store Procedure written in Python , that calls the API of Google Maps Geocode. Also, within this Store Procedure, I implemented a cache that continually saves the results from Google Maps to minimize the number of future calls.

Flow

We start by inputting the Search Term that we want to learn about. With this term, using an AJAX call I send the request. My server in turn goes and hit Twitter’s Search API to get the most recent tweets located in the US. Each tweet then goes to Google’s Natural Language API to get its prediction about the feeling or sentiment about the content of the tweet. If the tweet contains feel good words it gets tag as positive. After that each tweet is saved in a Postgres SQL database. Finally the server replies back with all the processed tweets and the information gets displayed in a map with their corresponding location and sentiment.

Visualization

I divided the results in three different views for better perception of the data. Using Jinja, BootStrap, JavaScript, and Google Maps API, this map shows more clearly the density of tweets in each location. This second map, shows the location of the tweet and its sentiment. Red is negative, Blues is positive and Yellow is Neutral. This last section, made with Google Charts, is a view of the leaning of the sentiment as a whole regardless of the location.

Upcoming

Currently, I am working on the addition of a Twitter Streaming API requests to get dynamic views of the data.

Database Model

alt text

hb-solo-final-project's People

Contributors

arivera007 avatar

Watchers

 avatar  avatar

Forkers

shuaiwang88

hb-solo-final-project's Issues

Database adjustments.

For table cachedgeocodes:

  • city should be unique
  • change the name from state to country
  • Keep all the data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.