Class: SeoParams::Netcraft
- Inherits:
-
Object
- Object
- SeoParams::Netcraft
- Defined in:
- lib/seo_params/netcraft.rb
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(url) ⇒ Netcraft
constructor
A new instance of Netcraft.
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
#all ⇒ Object
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 |