Sha256: 5327982a962dfc64ad9d0d5a16fa903fb6616fbef0f5a2253ba120d8b3caed23

Contents?: true

Size: 899 Bytes

Versions: 27

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

require "mihari/feed/reader"
require "mihari/feed/parser"

module Mihari
  module Analyzers
    class Feed < Base
      param :query

      option :http_request_method, default: proc { "GET" }
      option :http_request_headers, default: proc { {} }
      option :http_request_payload, default: proc { {} }
      option :http_request_payload_type, default: proc {}

      option :selector, default: proc { "" }

      def artifacts
        Mihari::Feed::Parser.new(data).parse selector
      end

      private

      def data
        reader = Mihari::Feed::Reader.new(
          query,
          http_request_method: http_request_method,
          http_request_headers: http_request_headers,
          http_request_payload: http_request_payload,
          http_request_payload_type: http_request_payload_type
        )
        reader.read
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

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