Skip to content

Instantly share code, notes, and snippets.

@nilsjesper
Last active November 23, 2016 16:18
Show Gist options
  • Save nilsjesper/bae589c5e4cfba38e69e to your computer and use it in GitHub Desktop.
Save nilsjesper/bae589c5e4cfba38e69e to your computer and use it in GitHub Desktop.
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
@nilsjesper
Copy link
Author

For Robot Voldemort version:

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 95 -v Whisper

@nilsjesper
Copy link
Author

In the interest of equal time, the BernieBot - https://gist.github.com/nilsjesper/9f84512c4305ee07e63b

@nilsjesper
Copy link
Author

If you've used up all of THOSE Trump quotes, here's his latest town hall:

curl -s -N --location https://www.washingtonpost.com/news/the-fix/wp/2016/03/30/donald-trump-did-a-cnn-townhall-last-night-and-it-was-a-classic/ \
| perl -0ne 'my @list = $_ =~ m/<span class="s1">TRUMP:(.*?)<\/span>/smg; print $list[rand @list]' \
| say -i -r 300 -v Alex

@nilsjesper
Copy link
Author

Updated w/ his latest interview...

curl -s -N --location https://www.washingtonpost.com/politics/donald-trump-transcript-the-republican-nominee-in-his-own-words/2016/08/02/77e9fa68-58eb-11e6-831d-0324760ca856_story.html \ | perl -0ne 'my @list = $_ =~ m/<p>TRUMP:(.*?)<\/p>/smg; print $list[rand @list]' \ | say -i -r 300 -v Alex

@nilsjesper
Copy link
Author

nilsjesper commented Nov 23, 2016

Updated with now president-elect Trump's NYTimes editorial round table

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment