Skip to content

Instantly share code, notes, and snippets.

@masaki925
Created June 17, 2016 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save masaki925/f5e2fcc16ad4db4236daa9430f101d13 to your computer and use it in GitHub Desktop.
Save masaki925/f5e2fcc16ad4db4236daa9430f101d13 to your computer and use it in GitHub Desktop.
require "net/http"
require "uri"
proxy_addr = "localhost"
proxy_port = 3128
uri = URI.parse "http://www.ugtop.com/spill.shtml"
Net::HTTP.new(uri.host, uri.port, proxy_addr, proxy_port).start do |http|
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
puts response.body.scan(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment