Skip to content

Instantly share code, notes, and snippets.

@taf2
Created December 17, 2009 18:54
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 taf2/258939 to your computer and use it in GitHub Desktop.
Save taf2/258939 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
doc = Hpricot.XML(File.read(ARGV[0]))
c = 0
File.open("urls.txt","w") do|f|
(doc/:url).each do|url|
f << url.at(:loc).inner_text
f << "\n"
c+=1
end
end
puts "Wrote #{c} urls to urls.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment