Skip to content

Instantly share code, notes, and snippets.

@swalberg
Created March 11, 2014 00:17
Show Gist options
  • Save swalberg/9477159 to your computer and use it in GitHub Desktop.
Save swalberg/9477159 to your computer and use it in GitHub Desktop.
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://en.wikipedia.org/wiki/List_of_The_Price_Is_Right_pricing_games'))
puts doc.css('h4 span.mw-headline').map(&:inner_text).sample
@abevoelker
Copy link

Sheeeet if you're gonna get all fancy with the selectors just do it right in the browser console! :-)

var e = $('h4 span.mw-headline'); $(e[Math.floor((Math.random()* e.length )+1)]).text();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment