class Plugins::DNSBlacklist

Public Instance Methods

dnsbl_lookup(m, host) click to toggle source

Methods

# File lib/Zeta/plugins/dnsbl.rb, line 18
def dnsbl_lookup(m, host)
  client = DNSBL::Client.new
  query = client.lookup(host.rstrip)

  if query.empty?
    m.reply "No Results Found (#{host})"
  elsif query.last.dnsbl == 'URIBL' && query.last.meaning == '127.0.0.1'
    m.reply "No Results Found (#{host})"
  else
    m.reply "Listed ⁘ #{host} ⁜ #{query.last.meaning} ⁜ Hits: #{query.count}"
  end
end