Class: Aquatone::Collectors::Hackertarget
- Inherits:
-
Aquatone::Collector
- Object
- Aquatone::Collector
- Aquatone::Collectors::Hackertarget
- Defined in:
- lib/aquatone/collectors/hackertarget.rb
Constant Summary collapse
- API_BASE_URI =
"https://api.hackertarget.com"
Constants inherited from Aquatone::Collector
Aquatone::Collector::DEFAULT_PRIORITY
Instance Attribute Summary
Attributes inherited from Aquatone::Collector
Instance Method Summary collapse
Methods inherited from Aquatone::Collector
descendants, #execute!, #initialize, meta, meta=, priority, sluggified_name
Constructor Details
This class inherits a constructor from Aquatone::Collector
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# 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 |