Inspiration

I am part of many communities online, but I have found that many people in each community often have varying views on the quality of their subreddit. My goal is to use more outside and automated ways to answer the question: "Which subreddit has it worse?"

What it does

It scrapes the top news links on each subreddit looked at. Once it has these, it sends the contents of each article over to Microsoft Azure, which uses its language processing to return a value of 0 to 1 based on how negative the article was. My program then averages these result for each subreddit and displays it as a graph.

Each subreddit gets a "Happiness Index" where a higher score means that the articles there are more positive.

How I built it

This program was built entirely with python libraries. I used Praw to access Reddit's API, Article to download and get the contents of each article, Microsoft Azure to process the articles, and matplotlib to finally plot out the result.

Challenges I ran into

Testing this script was fairly difficult, as even a small dataset of 15 articles takes a while to download and parse. There were also bugs that would only reveal themselves after I would wait for 10 - 15 minutes!

Accomplishments that I'm proud of

I have never used any of the above technologies in one of my projects, so I have learned quite a bit the different technologies involved.

One common sentiment I have seen is that r\politics is seen as more depressing than other subreddits. Looking at the output, this is confirmed with the numbers! As well, we see that r\UpliftingNews is near the top, which is also to be expected from this report!

What I learned

I learned how to access various web API's and how to deal with downloading and parsing articles with scripts.

What's next for Reddit News Happiness

Instead of filtering by the communities that share the articles, we can filter by the source of the article itself, to see how positive or negative each news publisher is. Another way we could go is to try and read regular text posts, which could give a different answer to "What is the most depressing subreddit"

Built With

Share this project:

Updates