Class: SiteInspector::Endpoint::Wappalyzer

Inherits:
Check
  • Object
show all
Defined in:
lib/site-inspector/checks/wappalyzer.rb

Constant Summary collapse

ENDPOINT =
'https://api.wappalyzer.com/lookup/v2/'

Instance Attribute Summary

Attributes inherited from Check

#endpoint

Instance Method Summary collapse

Methods inherited from Check

enabled=, enabled?, #host, #initialize, #inspect, #name, name, #response

Constructor Details

This class inherits a constructor from SiteInspector::Endpoint::Check

Instance Method Details

#to_hObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/site-inspector/checks/wappalyzer.rb', line 8

def to_h
  return {} unless data['technologies']

  @to_h ||= begin
    technologies = {}
    data['technologies'].each do |t|
      category = t['categories'].first
      category = category ? category['name'] : 'Other'
      technologies[category] ||= []
      technologies[category].push t['name']
    end

    technologies
  end
end