-
-
Save jasonm/172414 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# via http://robots.thoughtbot.com/post/168368158/lets-get-ready-to-rummmmmmmble | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
def get_stock_name | |
doc = Hpricot(open('http://stocknames.info')) | |
names = doc / '.list ul li' | |
names[rand(names.size)].innerText | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment