Sha256: 990679b582f661a97fce90af9b96814118b22a50f717212f93a0507b2e528871

Contents?: true

Size: 671 Bytes

Versions: 4

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

module Miteru
  class Feeds
    class UrlScanPro < Base
      #
      # @param [String] base_url
      #
      def initialize(base_url = "https://urlscan.io")
        super(base_url)

        @headers = {"api-key": api_key}
      end

      def urls
        (json["results"] || []).map { |result| result["page_url"] }
      end

      private

      def api_key
        Miteru.config.urlscan_api_key
      end

      def q
        "date:#{Miteru.config.urlscan_date_condition}"
      end

      def format
        "json"
      end

      def json
        get_json("/api/v1/pro/phishfeed", params: {q:, format:})
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
miteru-2.0.3 lib/miteru/feeds/urlscan_pro.rb
miteru-2.0.2 lib/miteru/feeds/urlscan_pro.rb
miteru-2.0.1 lib/miteru/feeds/urlscan_pro.rb
miteru-2.0.0 lib/miteru/feeds/urlscan_pro.rb