class Aquatone::Collectors::Hackertarget

Constants

API_BASE_URI

Public Instance Methods

run() click to toggle source
# File lib/aquatone/collectors/hackertarget.rb, line 12
def run
  response = get_request("#{API_BASE_URI}/hostsearch/?q=#{url_escape(domain.name)}")
  if response.code != 200
    failure("HackerTarget API returned unexpected response code: #{response.code}")
  end
  response.body.each_line do |line|
    host = line.split(",", 2).first.strip
    add_host(host) unless host.empty?
  end
end