class Osakana::Enrichers::Robtex

Public Instance Methods

api() click to toggle source
# File lib/osakana/enrichers/robtex.rb, line 8
def api
  @api ||= ::Robtex::API.new
end
domain_to_ipv4(domain) click to toggle source
# File lib/osakana/enrichers/robtex.rb, line 12
def domain_to_ipv4(domain)
  results = api.fpdns(domain)
  result = results.find do |res|
    res.dig("rrtype") == "A"
  end
  result&.dig("rrdata")
end
ipv4_to_domain(ipv4) click to toggle source
# File lib/osakana/enrichers/robtex.rb, line 20
def ipv4_to_domain(ipv4)
  res = api.ip(ipv4)
  active = res.dig("act")
  active&.first&.dig("o")
end