Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ip_whois(m, ip, args="")
- w = Whois.whois(ip)
- hash, string, args = {}, [], args.split
- w = w.to_s.split("\n").each {|line| begin; hash[line.split(':')[0].to_sym] = line.split(' ',2)[1]; rescue Exception; end }
- args.each do |arg|
- strings.push "#{arg}: #{hash[arg.to_sym]}"
- end
- m.reply "Netrange: #{hash[:NetRange]}"
- m.reply "Netname: #{hash[:NetHandle]}"
- m.reply "Organization: #{hash[:OrgName]}"
- m.reply "Country: #{hash[:Country]}"
- strings.each do |string|
- m.reply string
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement