Sha256: 5355beb0c93b0ac4cfb99f92e27db75b4e2d11852c80d3fe8b280ce46c639cab
Contents?: true
Size: 798 Bytes
Versions: 16
Compression:
Stored size: 798 Bytes
Contents
# frozen_string_literal: true require "dnpedia" module Mihari module Analyzers class DNPedia < Base attr_reader :query attr_reader :title attr_reader :description attr_reader :tags def initialize(query, title: nil, description: nil, tags: []) super() @query = query @title = title || "DNPedia domain lookup" @description = description || "query = #{query}" @tags = tags end def artifacts lookup || [] end private def api @api ||= ::DNPedia::API.new end def lookup res = api.search(query) rows = res.dig("rows") || [] rows.map do |row| [row.dig("name"), row.dig("zoneid")].join(".") end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems