Inspiration
Politics can be scary. Since it affects so many people, it’s important to know your information before you get involved with politics. You should know where news articles lie on the political spectrum. That’s why we created the Bias Monitor.
What it does
Bias Detector analyzes news articles and displays the direction as well as the degree of the bias present in that article. It will also keep a running average of the degree of bias of past news articles in order to give a diverse reading score. We also made it so that it only runs only on news sites.
How we built it
The Bias Monitor is a Google Chrome extension, built primarily with HTML, CSS, and JavaScript. To manage all of our dependencies, we utilized NodeJS and Webpack as our static module bundler. The Bipartisan Press’ Robert API was used to determine the bias of news articles. The API requires text to feed through, and it will return a numerical value which indicates the political bias. We wrote our own web scraper to scrape articles, and we made sure to only scrape news web pages. To only check for news articles, we have a list of all news outlets on the internet stored in a file to check to see if the current page is a news site or not.
Challenges we ran into
We ran into chrome extension local storage issues with Webpack. Webpack does not allow JavaScript files that are injected into the extension to store to the chrome local storage. To fix this issue, we had to use a separate script that runs on the web browser instead of the extension and send information from this script to the extension.
At the start of the hackathon, we were not able to send POST requests due to the infamous CORS issue. The solution for this was to not use Axios and use XMLHttpRequests in its place.
Accomplishments that we're proud of
We were able to complete a working Chrome extension that is very useful for checking political bias in news articles. The API we used was something new to us, but we were able to successfully integrate it into our extension.
What we learned
We learned that Chrome extensions are essentially HTML pages that are being loaded on top of the web browser’s HTML pages.
What's next for Bias Detector
We plan on making extensions for other web browsers such as Firefox.
Built With
- node.js
- webpack
Log in or sign up for Devpost to join the conversation.