Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Created May 26, 2016 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo0107/714ece62cf6450386ff0fb16fd5b777a to your computer and use it in GitHub Desktop.
Save kenzo0107/714ece62cf6450386ff0fb16fd5b777a to your computer and use it in GitHub Desktop.
# encoding: utf-8
require 'open-uri'
web_contents = open('http://ftp.apnic.net/stats/apnic/delegated-apnic-latest')
File.open(web_contents) do |f|
while line = f.gets
if line =~ /ipv4/ && line =~ /JP/
contents = line.split('|')
ip = contents[3]
puts ip
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment