We wanted to create an app that accessed and interconnected multiple APIs. With mental health being a very important issue, we wanted to create an app that at a glance can identify someone's mood. With the popularity of social media an easy way to tell someone's mood at a glance can be what they post. Studies have shown the suicide victims often post about their depression and go unnoticed. This led us to creating an app that can show someone's mood breakdown by analyzing their social media activity. An added functionality of this application is quick and easy background checks for potential job applicants.

What it does

Twinfo operates as both a website and a chrome plugin for analyzing twitter accounts and acquiring a mood breakdown.

Website Functionality: When on the Twinfo website you can input a twitter handle (@) and scan it. This scan returns a visual depiction of the user’s mood breakdown by analyzing all their tweets, retweets, and replies. The user’s mood “score” is displayed both in text form on the website and as a visual pie chart giving a clear and concise breakdown. If the user falls over a specific threshold a warning message is displayed urging the user to reach out and seek help. Although it only uses test data for now, Twinfo would also be able to compare two users to each other as well as provide site wide mood breakdowns. The site wide mood breakdowns would be able to show how current social/political issues affect the site’s population as a whole.

Plugin Functionality: When visiting a user’s Twitter page, the Twinfo plugin can be used to quickly scan the user’s page and acquire a basic breakdown. The plugin shows the user’s mood “score” in text form and will also urge the user to reach out if they fall over the same threshold used on the website.

How we built it

In total we used 3 different APIs to complete this project. We used the Twitter Developer API to gather a user’s tweets, retweets, and replies. The username is used to get the userID to be able to access the tweets. These tweets are then saved and passed on to the Twinword API which analyzes them and calculates the user’s mood “score”. This mood score is then passed on to the Google Visualization API on our webpage and displayed to the user. Our process for building this website was done modularly, in the sense that each group member was given a specific task and we brought it all together in the end. This was beneficial to optimum time management. It was also very fun and satisfying to bring everything together and complete the puzzle at the end.

Challenges we ran into

The biggest challenge we encountered was the interaction between Twinword API and the Google Visualization API. We built our website using test data at first that was displayed using the Google Visualization API. Our site worked fine with the test data but when it came to taking our mood “score” from the Twinword API and displaying it using the Google Visualization API difficulties arose. It was a challenge to convert our backend server code to use the new live data and display that data properly. In the end we managed to get it to work and the two APIs interact smoothly.

Accomplishments that we're proud of

Something that we are especially proud of is successfully linking both the website portion of our project and the chrome plugin portion of our project together, and having them retrieve data from the same API. Considering this is the first time any of us have used this API, things came together rather smoothly due to the fact that we planned ahead on this implementation, and designed our code structure around it.

What we learned

We gained a lot of new knowledge on API usage which is what we set out to accomplish this hackathon. We learned a lot about both the challenges and advantages of using APIs, especially when it comes to making them interact with each other. We also learned a lot about building a website and the challenges and difficulties that come with that. Especially how our APIs interacted and integrated with our website when it came to the HTML and js sides of things.

What's next for Twinfo

Our API account has a limited number of calls, but with an unlimited amount of calls and the ability to pull an unlimited number of tweets, we would want to implement a site-wide breakdown of all of twitter’s mood, and be able to graph how the overall mood changes. This would be great to see how the general population is relating to current events going on in the world. We would also want to add functionality to search not only by users, but by hashtags or location, and identify so-called “hotspots” where users in certain areas or using certain hashtags are more depressed than average. We would also want to add more specific search parameters, such as specifying the timeframe of tweets, or limiting the query to a certain number of tweets. We also would like to be able to use Twinfo to analyze a twitter account’s portion of sponsored tweets, to be able to tell if an account is saying authentic opinions, or just delivering advertising content.

Built With

Share this project: