Sha256: 4391c8c1225015981d1f0141cae3b844fe5deb3532551ca9214a2cce262d539a
Contents?: true
Size: 737 Bytes
Versions: 13
Compression:
Stored size: 737 Bytes
Contents
# frozen_string_literal: true require "urlscan" module Miteru class Feeds class UrlScan < Feed attr_reader :size def initialize(size = 100) @size = size raise ArgumentError, "size must be less than 10,000" if size > 10_000 end def api @api ||= ::UrlScan::API.new end def urls urls_from_community_feed rescue ::UrlScan::ResponseError => e puts "Failed to load urlscan.io feed (#{e})" [] end private def urls_from_community_feed res = api.search("task.method:automatic", size: size) results = res["results"] || [] results.map { |result| result.dig("task", "url") } end end end end
Version data entries
13 entries across 13 versions & 1 rubygems