Created
December 9, 2015 14:20
-
-
Save kossoff/8921878ec9fef4e8fafc 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
require 'rubygems' | |
require "net/http" | |
require "net/https" | |
require 'nokogiri' | |
XML = Nokogiri::HTML open "sitemap.xml" | |
links = XML.css "loc" | |
links.each do |link| | |
uri = URI link.text | |
Net::HTTP.start uri.host, uri.port, :use_ssl => false, :verify_mode => OpenSSL::SSL::VERIFY_NONE do |http| | |
request = Net::HTTP::Get.new uri | |
response = http.request request | |
puts "Response headers: #{response.to_hash.inspect}" | |
end | |
sleep 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment