Considering recent world events, we wanted to figure out a way to ensure the safety of protestors on the front lines of a long-due revolution.
What it does
Our Twitter bot (@BotProtests) is an account that 1) detects tweets that have pictures of protestors not wearing masks (to alert users that it’s unsafe to post these) 2) retweets live, informative tweets on protests, details of where it’s happening, police presence, unmarketed vehicles, and medical centers. We have connected it to a front-end web app that receives the tweets from the Bot and displays it on the site, along with other helpful resources and metrics demonstrating the impact of our bot.
How I built it
For our facial detection, we used openCV in Python to scan pictures we scraped from twitter. If a face was found, we used tweepy to reply to these tweets and notify users to delete or report the photo.
For the live streaming feed, we used Tweepy Stream Listener to get live tweets from protests. We retweet important and relevant information using our information criteria.
Challenges I ran into
Gathering metrics for site Asynchronous streaming of tweets and scoring tweet criteria
Accomplishments that I'm proud of
Having facial recognition Web app analyzing key metrics and impact Bot that can gather relevant information & consolidate for protestors
What I learned
How to authenticate other users with tweepy so other accounts can use our app.
What's next for Protest Parrot
Implementing natural language processing to interpret protest data better Users interacting with the acct., especially with the mask facial recognition, to improve our alg.
The database was designed and created in order to collect data from the tweets such as user information (id, name, location, picture), tweet information (id, hashtags, mentions, media), etc. It was developed first creating a code in Python that allows us to retrieve these information from the tweets and store it in .JSON files, then it exports all this data to the columns in the database (developed in SQL server). The Python code was then modified to retrieve the live data without using .JSON files, by splitting and parsing strings in order to get the desired information, this code was useful to retrieve the media_url in tweets containing images, this way we could use the facial detection feature.