Fun with the Python Reddit API Wrapper and word clouds

I got bored today and threw together some Python code to scrape word frequencies from Reddit and make word clouds. Everyone on Reddit seemed to love them, so I put them up on github so everyone could start making their own word clouds. All that’s really left to do is connect these scripts to a word cloud generating library so we don’t even have to copy & paste text into Wordle any more. If you’re up to the task, please email me and fork away on github.

Making word clouds for subreddits is a surprisingly effective way to get a gist for what a subreddit is really talking about. Take /r/evolution, for example. They’re serious business about evolution.

evolution

Others were more amusing. /r/trees, for example, seems to be preoccupied with cursing about things.

trees

whereas /r/aww can be concisely described by “upvote cats, fuck humans.”

aww

Even the /r/space nerds seem to get riled up when discussing NASA, terraforming, and meteorites.

space

Come join in on the fun and make some word clouds for your favorite subreddit: https://github.com/rhiever/reddit-analysis

Dr. Randy Olson is the Lead Data Scientist at Life Epigenetics, Inc., where he is bringing advanced data science and machine learning technology to the life insurance industry.

Tagged with: , , ,
2 comments on “Fun with the Python Reddit API Wrapper and word clouds
  1. Zoheb Siddiqui says:

    how far back does it scrape for data?

    • Randy Olson says:

      By default, it goes back a month. It’s possible to change the code so it goes back a day, week, or even year. For larger subreddits, I don’t advise scraping back further than a year.

2 Pings/Trackbacks for "Fun with the Python Reddit API Wrapper and word clouds"
  1. […] I got bored and hastily hacked together a script to scrape word frequencies from Reddit and make word clouds out of them. Of course, I included the source code on github so everyone else could use the script if they […]

  2. […] Randy Olson visualized the evolution of Michigan State University’s football program using word clouds. The bigger the word is in the visualization, the more it was brought up in conversation. The […]