Skip to content

Instantly share code, notes, and snippets.

@tessi
Created July 20, 2011 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tessi/1094681 to your computer and use it in GitHub Desktop.
Save tessi/1094681 to your computer and use it in GitHub Desktop.
if you need an insult to work faster...
require 'nokogiri'
require 'open-uri'
# thanks to Rosalily for the list of insults
doc = Nokogiri::HTML(open('http://www.cloudnet.com/~renfest/insults.htm'))
# works fine if you need positive feedback too ;)
# http://hubpages.com/hub/List-Of-Positive-Daily-Affirmations
insults = doc.at_css('body ul ul ul ul ul').children.select {|c| c.name =='li'}.map {|c| c.children[0].text}
loop { %x{ say "#{insults.shuffle.first.upcase}"; sleep #{rand(10000)+1000} } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment