It is said that the Romans and Native Americans believe the magpie bird symbolizes high intellect, perception, and reasoning powers. In this age of information, it can be difficult and overwhelming to find all sides of a story. And with the rise of social media platforms used for information, it’s more important now than ever before to ensure people have the correct information and context to stay up to date on the world. Introducing, Magpie - a Twitter extension.

What it does

Magpie is a simple, yet effective tool which allows Twitter users to easily get informed and get access to resources, such as news articles, related to tweets they engage with. Oftentimes, when reading different tweets, context and details can be lost and many times users would love to find more information on the key topics mentioned in the tweet. No matter how hard a person tries, 280 characters simply is not enough sometimes to convey a detailed message. Magpie easily empowers users to get informed regarding a tweet without ever having to leave the site.

Cool Render

Magpie accomplishes this in a simple way. Simply go to the chrome extension store on any chromium-based browser, download the extension, and the whole application is installed. Now it’s as easy as going to your Twitter and getting informed. When scrolling through Twitter on a desktop, Magpie will add an unobtrusive icon to the bottom of every tweet. Clicking on this icon opens up a window that blends in with the user’s timeline. Machine learning and natural language processing is then utilized to extract the important and primary words from the Tweet. These words are then used to search for and cross reference any and all related news articles. The user is then presented the list of different new sources relating to the current tweet. This includes a title, description, date, image, and sentiment analysis score. Each of these cells can be clicked to open up the article in a new tab for further reading.

Extension button clicked

Reply to Tweet

Sentiment Analysis

The goal for the sentiment analysis was to be able to process the content of each article being presented and inform the user about the overall content written and potentially how positive or negative the author felt about the subject. Machine learning is utilized to scan the entire text of the article and determine the sentiment, or mood, that the author conveys. The sentiment analysis factors in diction, tone, syntactical structure, grammar, and more. This empowers the user to view articles on both sides of an argument and allows them to gain an informed opinion while being aware of how emotionally charged a source may be.

Sentiment / Article View

To build on top of this functionality discussed, we wanted users to be able to easily share these articles and their findings with the original tweet and engage more easily. Each article presented in the window also includes a reply button. Pressing on this will automatically open up the reply page and prefill the reply tweet with the link to the article. Additional comments or thoughts can be added before replying as well.

How we built it

Here's a little bit about the techstack: The backend is built using flask and python, which leverages the fast beautifulsoup web scraping library coupled with Google’s natural language API to quickly and effectively pick out keywords in every tweet and search for those to get articles relevant to the original tweet. Each article is then run through the natural language api itself in an efficient manner and assigned a sentiment score. The backend was then deployed on Heroku for our frontend to interact with. We wanted to keep the frontend pretty lightweight, so we chose to go with vanilla javascript and tailwind css to clean up the UI. The Twitter API is used here to get access to the contents of tweets, which is then sent to the backend and also used for the reply functionality. JQuery was leveraged to integrate the UI with the twitter website so it flows seamlessly. Magpie is currently in the process of being deployed on the chrome web store and will be available soon!

Reply to Tweet with Article

Techstack diagram

Challenges we ran into

One of the biggest challenges of this project was getting enough information to the user in a timely manner. BeautifulSoup supplies great functionality to compile web articles and scrape data, however, this scraping can get slow due to the several websites we survey on each call. To circumvent this, we applied some optimization techniques to only read important content on the website that was relevant to the article.

Accomplishments that we're proud of

With Magpie, we wanted to find a healthier way to share information while also helping users build more trust with the Tweets they engage with. It’s fast, has beautiful animations, and easily integrates into a users’ current Twitter ecosystem. There’s no additional website or phone app that needs to be downloaded and signed into. Magpie is built directly into the Twitter web browser, and users’ will have no hassle installing and using the extension.

What we learned

We learned several new APIs such as Twitter's API, Google's Natural language API and the basics of making a chrome extension as it was our first time doing so. Making this was super fun and a great learning experience and are looking forward to launching on the chrome web store!

What's next for MagPie

Magpie is currently in the review process for being accepted on the chrome web store. We would love to improve on current functionality to help make the extension fast and make the overall experience better.

Frontend GitHub repo Backend GitHub repo

+ 24 more
Share this project: