Created
May 11, 2016 19:47
-
-
Save anonymous/a2b4d2ab05533e93d794f536a2e8a701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Data Structure #<CenSys::Search::IPv4:0x0000000260f520 @attributes={"ip"=>"45.58.72.171", "protocols"=>["443/https", "80/http"]}, @api=#<CenSys::API:0x0000000261d120 @secret="xxxx", @id="xxxx", @ipv4=#<CenSys::API::Resource:0x0000000261d008 @type=:ipv4, @api=#<CenSys::API:0x0000000261d120 ...>>, @websites=#<CenSys::API::Resource:0x0000000261cfe0 @type=:websites, @api=#<CenSys::API:0x0000000261d120 ...>>, @certificates=#<CenSys::API::Resource:0x0000000261cfb8 @type=:certificates, @api=#<CenSys::API:0x0000000261d120 ...>>>> | |
# | |
# | |
# My horrible test code | |
# | |
#!/usr/bin/ruby | |
require 'pp' | |
require 'censys' | |
require 'pry' | |
#api = CenSys::API.new('1f02fd16-393d-47e1-93d2-5a7df893ec9f','Igf4RCRdUNloYX5Sii47jCv3fyf7o') | |
api = CenSys::API.new | |
#Search for IPv4 addresses: | |
ipresponse = api.ipv4.search(query: 'dropbox.com') | |
ipresponse.each_page do |page| | |
puts ">>> Page ##{page.metadata.page} / #{page.metadata.pages} ..." | |
puts page # I want to print out the IP address + Protocol but this fails | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment