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