Inspiration

Reddit is a popular social media site often used to share links to external sites and talk about the content. It’s divided into tons of subforums called subreddits which focus on any topic under the sun, from r/news to r/breadstapledtotrees. In the age of information, we want to know what information is being shared and how people are engaging with it, so we designed a tool to gather information about external links shared on reddit subreddits.

What It Does

The script loads 1000 posts, either from newest or top, from a subreddit of the user’s choice, and searches the URLS of any external link for a keyword entered by a user. For example, a user might search up the newest posts in r/news for external links containing “cnn.com” and find that 33 of 637 external links contain the phrase. If at least one match is fund, the script then generates a pie chart displaying the proportion of external links that contained the user’s keyword as well as histogram and boxplot charts showing the distribution of the scores and comments of the keyword-containing posts.

How We Built It

Using Python, the pandas library for making plots, and the Reddit API

Challenges We Ran Into

We are both new to hackathons and Python. We had to figure out how to access and use APIs, and then learn how to create plots. The way lists work in Python took some getting used to as it is different from MATLAB and Java.

Accomplishments We’re Proud Of

We have used an API for the first time, searched through the internet from a kernel as opposed to a Google search bar, and created plots and tables using Python. We were able to get results based on a user’s input, so this can truly be a tool rather than an example.

What We Learned

We learned how APIs work, how to install and use Python libraries using Pypi, and how to create charts and table learned how much r/conservative links to Breitbart.

What’s Next

Next, we’d like to use Flask and Google Cloud to get the tool online for others to use! Of course, we’d also like to use HTML and CSS to add some sort of user interface, as well as add in some gui so that the user can fill out a visible form and submit it to the program.

Built With

Share this project:

Updates