Skip to content

Instantly share code, notes, and snippets.

@elberskirch
Last active September 26, 2015 02:18
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 elberskirch/1022985 to your computer and use it in GitHub Desktop.
Save elberskirch/1022985 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Query vogelisms.com to collect quotes
require 'rubygems'
require 'open-uri'
require 'nokogiri'
if ARGV.empty?
puts "vogelisms.rb [number]"
puts "Scrapes vogelisms.com [number] of times -> [number] of quotes"
puts "No check for double quotes"
end
amount = ARGV[0].to_i
for it in 1..amount do
doc = Nokogiri::HTML(open('http://www.vogelisms.com'))
text = doc.css('div.dq_quote').text
if text != nil
puts "--------------------------"
puts "VOGELISM ##{it}"
puts "--------------------------"
puts text
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment