Sha256: bad184834fc50b6fd6194e39f48fa128c01a1a938f2c9bac001e5e7e5acc7c62

Contents?: true

Size: 661 Bytes

Versions: 9

Compression:

Stored size: 661 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
        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

9 entries across 9 versions & 1 rubygems

Version Path
miteru-2.3.1 lib/miteru/feeds/urlscan_pro.rb
miteru-2.3.0 lib/miteru/feeds/urlscan_pro.rb
miteru-2.2.4 lib/miteru/feeds/urlscan_pro.rb
miteru-2.2.3 lib/miteru/feeds/urlscan_pro.rb
miteru-2.2.2 lib/miteru/feeds/urlscan_pro.rb
miteru-2.2.1 lib/miteru/feeds/urlscan_pro.rb
miteru-2.2.0 lib/miteru/feeds/urlscan_pro.rb
miteru-2.1.1 lib/miteru/feeds/urlscan_pro.rb
miteru-2.1.0 lib/miteru/feeds/urlscan_pro.rb