Skip to content

Instantly share code, notes, and snippets.

@nilsjesper
Last active March 24, 2016 19:51
Embed
What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment