Class: Shodan::Clients::Query

Inherits:
Base
  • Object
show all
Defined in:
lib/shodan/clients/query.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST

Instance Attribute Summary

Attributes inherited from Base

#key

Instance Method Summary collapse

Methods inherited from Base

#initialize, #key?

Constructor Details

This class inherits a constructor from Shodan::Clients::Base

Instance Method Details

#list(**params) ⇒ Object

Use this method to obtain a list of search queries that users have saved in Shodan.



9
10
11
# File 'lib/shodan/clients/query.rb', line 9

def list(**params)
  get("/shodan/query", **params)
end

#search(query, **params) ⇒ Object

Use this method to search the directory of search queries that users have saved in Shodan.



14
15
16
17
18
# File 'lib/shodan/clients/query.rb', line 14

def search(query, **params)
  params[:query] = query
  params = turn_into_query(params)
  get("/shodan/query/search", **params)
end

#tags(size = 10) ⇒ Object

Use this method to obtain a list of popular tags for the saved search queries in Shodan.



21
22
23
24
25
# File 'lib/shodan/clients/query.rb', line 21

def tags(size = 10)
  params = {}
  params[:size] = size
  get("/shodan/query/tags", **params)
end