Class: Plugins::DNSBlacklist

Inherits:
Object
  • Object
show all
Includes:
Cinch::Helpers, Cinch::Plugin
Defined in:
lib/Zeta/plugins/dnsbl.rb

Instance Method Summary collapse

Methods included from Cinch::Plugin

#check?, #log2chan

Instance Method Details

#dnsbl_lookup(m, host) ⇒ Object

Methods



18
19
20
21
22
23
24
25
26
27
28
29
# 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