Class: UrlScan::Clients::Community
- Defined in:
- lib/urlscan/clients/community.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #dom(uuid) ⇒ String
- #result(uuid) ⇒ Hash
- #screenshot(uuid) ⇒ Object
- #search(q, size: 100, search_after: nil) ⇒ Hash
- #submit(url, customagent: nil, referer: nil, visibility: nil, tags: nil, override_safety: nil, country: nil) ⇒ Hash
Methods inherited from Base
Constructor Details
This class inherits a constructor from UrlScan::Clients::Base
Instance Method Details
#dom(uuid) ⇒ String
26 27 28 |
# File 'lib/urlscan/clients/community.rb', line 26 def dom(uuid) get("/dom/#{uuid}/") { |dom| dom } end |
#result(uuid) ⇒ Hash
21 22 23 |
# File 'lib/urlscan/clients/community.rb', line 21 def result(uuid) get("/result/#{uuid}") { |json| json } end |
#screenshot(uuid) ⇒ Object
30 31 32 |
# File 'lib/urlscan/clients/community.rb', line 30 def screenshot(uuid) get("/screenshots/#{uuid}.png") { |png| png } end |
#search(q, size: 100, search_after: nil) ⇒ Hash
35 36 37 38 |
# File 'lib/urlscan/clients/community.rb', line 35 def search(q, size: 100, search_after: nil) params = { q: q, size: size, search_after: search_after }.compact get("/search/", params) { |json| json } end |
#submit(url, customagent: nil, referer: nil, visibility: nil, tags: nil, override_safety: nil, country: nil) ⇒ Hash
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/urlscan/clients/community.rb', line 7 def submit(url, customagent: nil, referer: nil, visibility: nil, tags: nil, override_safety: nil, country: nil) params = { url: url, customagent: customagent, referer: referer, visibility: visibility, tags: , overrideSafety: override_safety, country: country }.compact post("/scan/", params) { |json| json } end |