Skip to content

Instantly share code, notes, and snippets.

@thoughtbot
Created August 21, 2009 15:42
Show Gist options
  • Save thoughtbot/172119 to your computer and use it in GitHub Desktop.
Save thoughtbot/172119 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hpricot'
require 'open-uri'
doc = Hpricot(open('http://stocknames.info'))
names = doc / '.list ul li'
puts names[rand(names.size)].innerText
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment