Skip to content

Instantly share code, notes, and snippets.

@kossoff
Created December 9, 2015 14:20
Show Gist options
  • Save kossoff/8921878ec9fef4e8fafc to your computer and use it in GitHub Desktop.
Save kossoff/8921878ec9fef4e8fafc to your computer and use it in GitHub Desktop.
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