Skip to content

Instantly share code, notes, and snippets.

View nilsjesper's full-sized avatar

Martin Olson nilsjesper

  • StoryCorps
  • Brooklyn, NY
View GitHub Profile
@nilsjesper
nilsjesper / President-Elect Trump Word Salad Bot
Last active November 23, 2016 17:30
Takes a random Trump statement from his NY Times round-table and has your computer speak it. To chilling effect.
curl -s -b -N --location http://www.nytimes.com/2016/11/23/us/politics/trump-new-york-times-interview-transcript.html \
| perl -0ne 'my @list = $_ =~ m/>TRUMP:(.*?)<\/p>/smg; print $list[rand @list]' \
| say -i -r 300 -v Alex
@nilsjesper
nilsjesper / BernieBot
Last active March 24, 2016 19:51
BernieBot - Makes your mac speak a random Bernie Sanders response from a recent town hall. Sequel to the Random Donald Trump Word Salad Bot - https://gist.github.com/nilsjesper/bae589c5e4cfba38e69e
curl -s -N --location http://cnnpressroom.blogs.cnn.com/2016/03/13/full-rush-transcript-senator-bernie-sanders-cnn-tv-one-democratic-presidential-town-hall/ \
| perl -MHTML::Entities -0ne '$_ =~ s/\n//gi; push @list, $1 while $_ =~ m/SANDERS: (.*?)(ANNOUNCER|CLINTON|QUESTION|TAPPER|MARTIN)/smg; $out = decode_entities($list[rand @list]); $out =~ s/(<.*?>|[A-Z]{6,})//g; print $out' \
| say -i -r 300 -v Alex
@nilsjesper
nilsjesper / Random Donald Trump Word Salad Robot
Last active November 23, 2016 16:18
This is a quick bash script to make your Mac speak a random line from Donald Trump's Washington Post Editorial Interview. Because it sounds even crazier spoken by your computer. Just copy and paste into your terminal and hit return.
curl -s -N --location https://www.washingtonpost.com/blogs/post-partisan/wp/2016/03/21/a-transcript-of-donald-trumps-meeting-with-the-washington-post-editorial-board/ \
| perl -0ne 'my @list = $_ =~ m/<p>TRUMP:(.*?)<\/p>/smg; print $list[rand @list]' \
| say --progress -i -r 300 -v Alex