Class: Miteru::Feeds::UrlScan
- Defined in:
- lib/miteru/feeds/urlscan.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(base_url = "https://urlscan.io") ⇒ UrlScan
constructor
A new instance of UrlScan.
- #urls ⇒ Object
Methods inherited from Base
#call, #decomposed_urls, inherited, #source
Methods inherited from Service
Constructor Details
#initialize(base_url = "https://urlscan.io") ⇒ UrlScan
Returns a new instance of UrlScan.
9 10 11 12 13 |
# File 'lib/miteru/feeds/urlscan.rb', line 9 def initialize(base_url = "https://urlscan.io") super @headers = {"api-key": api_key} end |
Instance Method Details
#urls ⇒ Object
15 16 17 18 19 |
# File 'lib/miteru/feeds/urlscan.rb', line 15 def urls search_with_pagination.flat_map do |json| (json["results"] || []).map { |result| result.dig("task", "url") } end.uniq end |