project_honeypot/lib/project-honeypot.rb

29 lines
588 B
Ruby
Raw Normal View History

2012-12-18 16:53:38 +01:00
require 'net/dns'
2012-12-21 16:13:03 +01:00
require "project_honeypot/url"
require "project_honeypot/base"
require "project_honeypot/rack"
module ProjectHoneypot
class << self
attr_accessor :api_key
def api_key
raise "ProjectHoneypot really needs its api_key set to work" unless @api_key
@api_key
end
def configure(&block)
class_eval(&block)
end
end
def self.lookup(api_key_or_url, url=nil)
if url.nil?
url = api_key_or_url
api_key_or_url = ProjectHoneypot.api_key
end
searcher = Base.new(api_key_or_url)
searcher.lookup(url)
end
end