lib/censys.rb
def _search(keyword,search_type="certificates",page=1)
      
      payload = {
        :query => keyword,
        :flatten => false,
        :page => 1
      }

      response = RestClient::Request.new(
        :method => :post,
        :url => "#{@uri}/search/#{search_type}",
        :user => @uid,
        :password => @secret,
        :headers => { :accept => :json, :content_type => :json },
        :payload => payload.to_json
      ).execute

    JSON.parse(response.to_str)
    end
# search_type should be one of ipv4, websites, certificates
search_type should be one of ipv4, websites, certificates
search_type should be one of ipv4 websites certificates
def _search(keyword,search_type="certificates",page=1)
      payload = {
        :query => keyword,
        :flatten => false,
        :page => 1
      }
      response = RestClient::Request.new(
        :method => :post,
        :url => "#{@uri}/search/#{search_type}",
        :user => @uid,
        :password => @secret,
        :headers => { :accept => :json, :content_type => :json },
        :payload => payload.to_json
      ).execute
    JSON.parse(response.to_str)
    end
def _search ( keyword , search_type = "certificates" , page = 1 ) payload = { :query => keyword , :flatten => false , :page => 1 } response = RestClient :: Request . new ( :method => :post , :url => "#{@uri}/search/#{search_type}" , :user => @uid , :password => @secret , :headers => { :accept => :json , :content_type => :json } , :payload => payload . to_json ) . execute JSON . parse ( response . to_str ) end
search_type should be one of ipv4, websites, certificates
search_type should be one of ipv4 websites certificates
keyword
search_type
page