Class: SeoParams::Yahoo

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

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Yahoo

Returns a new instance of Yahoo.



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

def initialize(url)
  @url = url
  @response = Nokogiri::HTML(open("http://search.yahoo.com/search?p=site:#{url}"))
end

Instance Method Details

#yahoo_pagesObject



14
15
16
17
# File 'lib/seo_params/yahoo.rb', line 14

def yahoo_pages
  index = @response.xpath("//span[@id='resultCount']").first.children.to_s.delete! ","
  index.to_i
end