Sha256: 88559cec3076561947ff9353fa25f3b16dc8d0bcbd5ef9a81d429ab7a876adba

Contents?: true

Size: 649 Bytes

Versions: 27

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

require "dnpedia"

module Mihari
  module Analyzers
    class DNPedia < Base
      param :query

      option :tags, default: proc { [] }

      def artifacts
        search || []
      end

      private

      def api
        @api ||= ::DNPedia::API.new
      end

      #
      # Search
      #
      # @return [Array<Mihari::Artifact>]
      #
      def search
        res = api.search(query)
        rows = res["rows"] || []
        rows.map do |row|
          data = [row["name"], row["zoneid"]].join(".")
          Artifact.new(data: data, source: source, metadata: row)
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mihari-5.1.0 lib/mihari/analyzers/dnpedia.rb
mihari-5.0.1 lib/mihari/analyzers/dnpedia.rb
mihari-5.0.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.12.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.11.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.10.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.9.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.8.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.7.4 lib/mihari/analyzers/dnpedia.rb
mihari-4.7.3 lib/mihari/analyzers/dnpedia.rb
mihari-4.7.2 lib/mihari/analyzers/dnpedia.rb
mihari-4.7.1 lib/mihari/analyzers/dnpedia.rb
mihari-4.7.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.6.1 lib/mihari/analyzers/dnpedia.rb
mihari-4.6.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.5.3 lib/mihari/analyzers/dnpedia.rb
mihari-4.5.2 lib/mihari/analyzers/dnpedia.rb
mihari-4.5.1 lib/mihari/analyzers/dnpedia.rb
mihari-4.5.0 lib/mihari/analyzers/dnpedia.rb
mihari-4.4.1 lib/mihari/analyzers/dnpedia.rb