Class: SeoParams::Netcraft

Inherits:
Object
  • Object
show all
Defined in:
lib/seo_params/netcraft.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Netcraft

Returns a new instance of Netcraft.



9
10
11
12
# File 'lib/seo_params/netcraft.rb', line 9

def initialize(url)
  @url = url
  @response = Nokogiri::HTML(open("http://toolbar.netcraft.com/site_report?url=#{url}"))
end

Instance Method Details

#allObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/seo_params/netcraft.rb', line 14

def all

  h = Hash.new
  h["ip"] = get_ip
  h["siterank"] = get_siterank == 'unknown' ? 'n/a' : get_siterank.to_i
  h["country"] = get_country
  h["nameserver"] = get_nameserver
  h["firstseen"] = get_firstseen
  h["dnsadmin"] = get_dnsadmin
  h["domainregistrator"] = get_domainregistrator == 'unknown' ? 'n/a' : get_domainregistrator
  h["reversedns"] = get_reversedns
  h["organisation"] = get_organisation == 'unknown' ? 'n/a' : get_organisation
  h["nsorganisation"] = get_nsorganisation == 'unknown' ? 'n/a' : get_nsorganisation
  h

end