Last active
September 26, 2015 02:18
-
-
Save elberskirch/1022985 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
#!/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