Class: UrlScan::Clients::Community
- Inherits:
-
Base
- Object
- Base
- UrlScan::Clients::Community
show all
- Defined in:
- lib/urlscan/clients/community.rb
Constant Summary
Constants inherited
from Base
Base::HOST, Base::VERSION
Instance Attribute Summary
Attributes inherited from Base
#key
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#dom(uuid) ⇒ String
18
19
20
|
# File 'lib/urlscan/clients/community.rb', line 18
def dom(uuid)
get("/dom/#{uuid}/") { |dom| dom }
end
|
#result(uuid) ⇒ Hash
13
14
15
|
# File 'lib/urlscan/clients/community.rb', line 13
def result(uuid)
get("/result/#{uuid}") { |json| json }
end
|
#screenshot(uuid) ⇒ Object
22
23
24
|
# File 'lib/urlscan/clients/community.rb', line 22
def screenshot(uuid)
get("/screenshots/#{uuid}.png") { |png| png }
end
|
#search(q, size: 100, search_after: nil) ⇒ Hash
27
28
29
30
|
# File 'lib/urlscan/clients/community.rb', line 27
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, is_public = true) ⇒ Hash
7
8
9
10
|
# File 'lib/urlscan/clients/community.rb', line 7
def submit(url, is_public = true)
params = { url: url, public: is_public ? "on" : "off" }
post("/scan/", params) { |json| json }
end
|