Sha256: 314c1a4f05a54dbee8b9b19f128355a6e2cbda7d72d1fba55bfbb121dc84bfdf

Contents?: true

Size: 571 Bytes

Versions: 34

Compression:

Stored size: 571 Bytes

Contents

# Exact netname and description from the whois query on an IP
# Usage: ruby filter_netinfo.rb [file_ip] 
require	"wmap"


puts Wmap.banner
whois = Wmap::Whois.new(:verbose=>false)
#tracker = Wmap::CidrTracker.new

#puts "IP ;  Netname ; Net Reference"
f_ips = File.open(ARGV[0], 'r:iso-8859-1')
f_ips.each do |line|
	ip=line.chomp.split(',')[1]  
	if whois.is_ip?(ip) or whois.is_cidr?(ip) 
		netname=whois.get_netname(ip)
		desc=whois.get_net_desc(ip)
		#tr=tracker.track(ip)
		puts "#{line.chomp};#{netname};#{desc}"
	else
		puts "#{line.chomp};;"
	end
end
f_ips.close

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
wmap-2.5.9 demos/filter_netinfo.rb
wmap-2.5.8 demos/filter_netinfo.rb
wmap-2.5.7 demos/filter_netinfo.rb
wmap-2.5.6 demos/filter_netinfo.rb
wmap-2.5.5 demos/filter_netinfo.rb
wmap-2.5.4 demos/filter_netinfo.rb
wmap-2.5.2 demos/filter_netinfo.rb
wmap-2.5.1 demos/filter_netinfo.rb
wmap-2.5.0 demos/filter_netinfo.rb
wmap-2.4.9 demos/filter_netinfo.rb
wmap-2.4.8 demos/filter_netinfo.rb
wmap-2.4.6 demos/filter_netinfo.rb
wmap-2.4.5 demos/filter_netinfo.rb
wmap-2.4.4 demos/filter_netinfo.rb