Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Merge 57f9343 into 57d51e7
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Mar 8, 2020
2 parents 57d51e7 + 57f9343 commit e5be05f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ language: ruby
cache: bundler
rvm:
- 2.6
before_install: gem install bundler -v 2.0.1
- 2.7
before_install: gem install bundler -v 2.1
2 changes: 1 addition & 1 deletion lib/shodan/clients/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def create(name:, ip:)
ip: ip
}
}
post("/shodan/alert", params)
post("/shodan/alert", **params)
end

def delete_by_id(id)
Expand Down
4 changes: 2 additions & 2 deletions lib/shodan/clients/exploits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def search(query = "", facets: {}, page: 1, **params)
params = turn_into_query(params)
facets = turn_into_facets(facets)
params[:page] = page
get("/search", params.merge(facets))
get("/search", **params.merge(facets))
end

# This method behaves identical to the "/search" method with
Expand All @@ -31,7 +31,7 @@ def count(query = "", facets: {}, page: 1, **params)
params = turn_into_query(params)
facets = turn_into_facets(facets)
params[:page] = page
get("/count", params.merge(facets))
get("/count", **params.merge(facets))
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/shodan/clients/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Host < Base
# @option params [Hash]
# @return [Hash]
def get_by_ip(ip, **params)
get("/shodan/host/#{ip}", params)
get("/shodan/host/#{ip}", **params)
end

# This method behaves identical to "/shodan/host/search" with the only
Expand All @@ -22,7 +22,7 @@ def count(query = "", facets: {}, **params)
params[:query] = query
converted_params = turn_into_query(params)
facets = turn_into_facets(facets)
get("/shodan/host/count", converted_params.merge(facets))
get("/shodan/host/count", **converted_params.merge(facets))
end

# Search Shodan using the same query syntax as the website and use facets
Expand All @@ -33,15 +33,15 @@ def search(query = "", facets: {}, page: 1, minify: true, **params)
facets = turn_into_facets(facets)
params[:page] = page
params[:minify] = minify
get("/shodan/host/search", params.merge(facets))
get("/shodan/host/search", **params.merge(facets))
end

# This method lets you determine which filters are being used by
# the query string and what parameters were provided to the filters.
def tokens(query = "", **params)
params[:query] = query
params = turn_into_query(params)
get("/shodan/host/search/tokens", params)
get("/shodan/host/search/tokens", **params)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/shodan/clients/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ module Clients
class Query < Base
# Use this method to obtain a list of search queries that users have saved in Shodan.
def list(**params)
get("/shodan/query", params)
get("/shodan/query", **params)
end

# Use this method to search the directory of search queries that users have saved in Shodan.
def search(query, **params)
params[:query] = query
params = turn_into_query(params)
get("/shodan/query/search", params)
get("/shodan/query/search", **params)
end

# Use this method to obtain a list of popular tags for the saved search queries in Shodan.
def tags(size = 10)
params = {}
params[:size] = size
get("/shodan/query/tags", params)
get("/shodan/query/tags", **params)
end
end
end
Expand Down

0 comments on commit e5be05f

Please sign in to comment.