Inspiration
We wanted to see the face behind every Twitter trend, and in turn, see the differences in their demographics.
What It Does
It grabs compiled lists using the Twitter API which contain an assortment of location data; from coordinates to names of cities. The lists are then sent to our HTML page through an API call in Flask. The Google Maps JS API then takes over and posts each location on a clustering map.
How We Built It
This was built with a Flask backend, API calls to a Python script which grabs tweets and returns them through an HTTP GET call to an address, where the front end grabs the response. The JS then translates the array of geolocations to GPS coordinates, which are used to place markers on a map utilizing the Google Maps JS API. The map clusters the markers for readability sake.
Challenges We Ran Into
We had many struggles-when least expected-with both of the API's we were utilizing. It took a lot of time to get working code for both Twitter and Google Maps because of their steep learning curve. We also really struggled with correctly making and handling an HTTP Get call in Flask. Working with our JSON object was rough- it took us a while to realize the string to object function wasn't built into the jQuery command. It also took us too much time in our final hours to discover some errors we encountered were caused by hitting the limit of API calls we could make to the Geocoding API.
Accomplishments We're Proud Of
We're proud that we actually managed to get everything working. It was touch and go for a while and there were times that it looked like we wouldn't finish, but at the end of this event we have a working website (with very limited responsiveness).
What We Learned
Nick learned how to use Flask, Twitter's API, and JSON operations: "I'm super glad I got the chance to learn these technologies here at BoilerMake." Morgan furthered his skills in JavaScript/jQuery, Google Maps JS API (Geocoding, Marker Cluster, Map/Marker Creation), JSON, and minor back-end knowledge.
What's next for Trend Tracker
We've discussed adding in information from the 2010 census to get demographic information and let you know a little about the area the tweet is coming from. We also plan to figure out how to get out of the limited API calls (trust us, we tried everything would could to overcome in the last few hours). There is definitely a lot of potential in parsing through the geolocation of any open data; especially when used in a clustering map.
Thanks to the BoilerMake Organizers! We had a fun, but naturally frustrating, experience working on our hack.
Log in or sign up for Devpost to join the conversation.