Inspiration

The ridiculous tweets about with the candidates for the 2016 presidential election. We wanted to know who was viewed the most positively at any given moment in time.

What it does

Our project takes in two different keywords, hashtags, or phrases and searches Twitter with them. It collects recent Tweets and runs through them assessing the polarity (the negative/positive component) of each one before producing the average polarity of the the tweets associated with each search word. It gives the result from comparing the two with a sentence that reflects how significant the difference between them is -- i.e. People are slightly more positive towards Trump than Cruz or People are significantly more positive towards puppies than cats.

How we built it

We wrote a script in Python that searches for tweets with a word/phrase and pulls in the most recent ones related to the search word to analyze their polarity using the Patterns package. We also wrote a comparison function in that script to compare the average polarity of each search term.

We worked on creating an interactive website with HTML and Javascript. We integrated our front- and back-end development with Flask.

Challenges we ran into

Flask is not intuitive. It was difficult to integrate Python, HTML, and Javascript. The two parts worked well on their own, but together they were a bit messy.

Twitter only lets you make a certain numbers of searches per hour before you get locked out temporarily. We didn't think we'd get a license in time, so we just limited how big our searches were when we were testing our script.

We should have used github to share code, because while we were able to work separately in the beginning of the hackathon, by the end, we were all huddled around one computer.

Also, the package we used to assess Tweets' polarity , Patterns, doesn't pick up on sarcasm, so it's a bit limited, but we figured with a large enough sample size it would produce reasonable/accurate results.

Accomplishments that we're proud of

Our Python script works the way we want it too -- it can take the average polarity of any number of Tweets (as long as Twitter doesn't lock us out!).

Our website is functional! Not to the level we had envisioned -- it's a work in progress, but it's functional.

At our first hackathon, we succeeded in creating a functional product that does approximately what we wanted it too:)

What we learned

We should use github to share code.

We should ask for more help and earlier on so we don't waste time banging our heads against a wall.

Integrating front-end and back-end development is not as easy as it seems...

What's next for Tweeter

Putting it online. Making it more aesthetically pleasing and consistent.

Share this project:

Updates