Class: UrlScan::Commands::Community

Inherits:
Base
  • Object
show all
Defined in:
lib/urlscan/commands/community.rb

Direct Known Subclasses

UrlScan::CLI

Instance Method Summary collapse

Instance Method Details

#dom(uuid) ⇒ Object



47
48
49
50
51
52
# File 'lib/urlscan/commands/community.rb', line 47

def dom(uuid)
  with_error_handling do
    res = api.dom(uuid)
    puts res
  end
end

#result(uuid) ⇒ Object



29
30
31
32
33
34
# File 'lib/urlscan/commands/community.rb', line 29

def result(uuid)
  with_error_handling do
    res = api.result(uuid)
    puts JSON.pretty_generate(res)
  end
end

#screenshot(uuid) ⇒ Object



55
56
57
58
59
60
# File 'lib/urlscan/commands/community.rb', line 55

def screenshot(uuid)
  with_error_handling do
    res = api.screenshot(uuid)
    puts res
  end
end

#search(query) ⇒ Object



39
40
41
42
43
44
# File 'lib/urlscan/commands/community.rb', line 39

def search(query)
  with_error_handling do
    res = api.search(query, size: options["size"], search_after: options["search_after"])
    puts JSON.pretty_generate(res)
  end
end

#submit(url) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/urlscan/commands/community.rb', line 13

def submit(url)
  with_error_handling do
    res = api.submit(
      url,
      customagent: options[:customagent],
      referer: options[:referer],
      visibility: options[:visibility],
      tags: options[:tags],
      override_safety: options[:override_safety],
      country: options[:country]
    )
    puts JSON.pretty_generate(res)
  end
end