class DNSTwister::API
Public Instance Methods
fuzz(domain)
click to toggle source
Calculates the dnstwist “fuzzy domains” for a domain
@param [String] domain
@return [Hash]
# File lib/dnstwister/api.rb, line 12 def fuzz(domain) _get("/api/fuzz/#{to_hex(domain)}") { |json| json } end
ip(domain)
click to toggle source
Resolves Domains to IPs
@param [String] domain
@return [Hash]
# File lib/dnstwister/api.rb, line 34 def ip(domain) _get("/api/ip/#{to_hex(domain)}") { |json| json } end
parked(domain)
click to toggle source
Calculates “parked” scores from 0-1
@param [String] domain
@return [Hash]
# File lib/dnstwister/api.rb, line 45 def parked(domain) _get("/api/parked/#{to_hex(domain)}") { |json| json } end
safebrowsing(domain)
click to toggle source
Returns number of hits in Google Safe Browsing
@param [String] domain
@return [Hash]
# File lib/dnstwister/api.rb, line 23 def safebrowsing(domain) _get("/api/safebrowsing/#{to_hex(domain)}") { |json| json } end
whois(domain)
click to toggle source
Calculates the dnstwist “fuzzy domains” for a domain.
@param [String] domain
@return [Hash]
# File lib/dnstwister/api.rb, line 56 def whois(domain) _get("/api/whois/#{to_hex(domain)}") { |json| json } end
Private Instance Methods
to_hex(str)
click to toggle source
Converts string to hex
@param [String] str String
@return [String] Hex
# File lib/dnstwister/api.rb, line 69 def to_hex(str) str.each_byte.map { |b| b.to_s(16) }.join end