Sha256: 18f644d3c932dc7cebea307eee3bf7963c6c48d2b4cab62781cc870fb36e2f42

Contents?: true

Size: 661 Bytes

Versions: 14

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Clients
    #
    # Shodan Internet DB API client
    #
    class ShodanInternetDB < Base
      #
      # @param [String] base_url
      # @param [Hash] headers
      # @param [Integer, nil] timeout
      #
      def initialize(base_url = "https://internetdb.shodan.io", headers: {}, timeout: nil)
        super(base_url, headers: headers, timeout: timeout)
      end

      #
      # @param [String] ip
      #
      # @return [Mihari::Structs::Shodan::InternetDBResponse]
      #
      def query(ip)
        Structs::Shodan::InternetDBResponse.from_dynamic! get_json("/#{ip}")
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mihari-7.3.2 lib/mihari/clients/shodan_internet_db.rb
mihari-7.3.1 lib/mihari/clients/shodan_internet_db.rb
mihari-7.3.0 lib/mihari/clients/shodan_internet_db.rb
mihari-7.2.0 lib/mihari/clients/shodan_internet_db.rb
mihari-7.1.3 lib/mihari/clients/shodan_internet_db.rb
mihari-7.1.2 lib/mihari/clients/shodan_internet_db.rb
mihari-7.1.1 lib/mihari/clients/shodan_internet_db.rb
mihari-7.1.0 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.5 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.4 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.3 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.2 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.1 lib/mihari/clients/shodan_internet_db.rb
mihari-7.0.0 lib/mihari/clients/shodan_internet_db.rb