Opposable Thumbs Episode 4: Nick Bontrager/Stand Up Comedy

Meghan Trainor (no not that one) pitched us a curveball in Episode 3 with the “stand up comedy” challenge. Nick Bontranger was up to the task, and you can listen to his response here.

It occurred to me that I could enter this challenge in a completely straight-forward manner: by writing a traditional comedy set. This idea was immediately displaced by the urge to do something techie, so I started writing a script that could pull down humorous material from the web. Reddit seemed like a good place to look, given that it has a metric crapload of commentary to draw from (the following assumes you’re working in OSX).

  1. Make a new reddit account
  2. Follow these steps to create a script-type application (just follow the “first steps” section).
  3. Open your terminal and easy_install pip  (may need sudo)
  4. Now create a virtual Python environment for your project and activate it. Do this so random updates don’t tank your script. Take special note of source venv/bin/activate , which will put you in virtual mode for the next steps.
  5. pip install praw
  6. python mybot.py
  7. This script looks for comments that include the words “tragedy” or “time” and prints them in the terminal.
  8. For the final output I installed Soundflower, which allowed me to record straight off the sound card. I then had the OSX accessibility assistants read the text aloud and laugh at it robotically.
  9. See python code below:

Leave a Reply