Monday, December 30, 2013

Ruby script to grab a fake name out of fakenamegenerator.com

require 'open-uri'
require 'nokogiri'

Nokogiri::HTML(open('http://www.fakenamegenerator.com/')).xpath("//div[@class='address']/h3").collect {|node| puts node.text.strip}