Created
April 20, 2012 16:51
-
-
Save wilkerlucio/2430255 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'nokogiri' | |
require 'open-uri' | |
require 'webmock' | |
require 'vcr' | |
VCR.config do |c| | |
c.cassette_library_dir = 'vcr_cassettes' | |
c.stub_with :webmock | |
end | |
VCR.use_cassette("tvlist") do | |
puts "Loading list..." | |
xml = Nokogiri::HTML(open("http://en.wikipedia.org/wiki/List_of_television_programs_by_name")) | |
puts "Writing to file..." | |
File.open("series", "wb+") do |file| | |
xml.css("i a").each do |link| | |
file << link.content + "\n" | |
end | |
end | |
puts "Finished" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment