Created
March 13, 2013 23:01
-
-
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.
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 '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