Skip to content

Instantly share code, notes, and snippets.

@agmcleod
Created March 13, 2013 23:01
Show Gist options
  • Select an option

  • Save agmcleod/5157250 to your computer and use it in GitHub Desktop.

Select an option

Save agmcleod/5157250 to your computer and use it in GitHub Desktop.
To run, you need ruby 1.9.2+. Pass the csv containing urls as an argument.
require 'csv'
require 'net/http'
responses = []
CSV.foreach(ARGV[0]) do |row|
responses << "#{row},#{Net::HTTP.get_response(URI.parse(row[0]))}"
puts row
end
IO.write("url_responses.csv", responses.join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment