Skip to content

Instantly share code, notes, and snippets.

@hoodie
Last active October 24, 2015 15:30
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 hoodie/b314ff11efa18ec48b06 to your computer and use it in GitHub Desktop.
Save hoodie/b314ff11efa18ec48b06 to your computer and use it in GitHub Desktop.
give me a random nicolas cage movie
#!/bin/env ruby
require "net/http"
require "nokogiri"
puts Nokogiri::HTML(Net::HTTP.get(URI("https://en.wikipedia.org/wiki/Nicolas_Cage_filmography")))
.css("table.wikitable.sortable tr")
.map{|line| line.css("td i a").text}
.keep_if{|e|!e.strip.empty?}
.sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment