Sha256: 7760bd10c10a643c3c386b2c79dbad8f0427db917f9a44e0c5bd527843b8efe7
Contents?: true
Size: 674 Bytes
Versions: 9
Compression:
Stored size: 674 Bytes
Contents
# frozen_string_literal: true require "urlscan" module Miteru class Feeds class UrlScanPro < Feed def api @api ||= ::UrlScan::API.new end def urls urls_from_pro_feed rescue ::UrlScan::ResponseError => e puts "Failed to load urlscan.io pro feed (#{e})" [] end private def api_key? ENV.key? "URLSCAN_API_KEY" end def urls_from_pro_feed return [] unless api_key? res = api.pro.phishfeed results = res["results"] || [] results.map { |result| result.dig("page_url") } rescue ArgumentError => _e [] end end end end
Version data entries
9 entries across 9 versions & 1 rubygems