class Aquatone::Collectors::Threatcrowd

Constants

API_URI

Public Instance Methods

run() click to toggle source
# File lib/aquatone/collectors/threatcrowd.rb, line 13
def run
  response = get_request("#{API_URI}?domain=#{url_escape(domain.name)}")
  if response.code != 200
    failure("Threat Crowd API returned unexpected status code: #{response.code}")
  end
  body = JSON.parse(response.body)
  if body.key?("subdomains")
    body["subdomains"].each { |host| add_host(host) }
  end
end