Class: SeoParams::Bing
- Inherits:
-
Object
- Object
- SeoParams::Bing
- Defined in:
- lib/seo_params/bing.rb
Instance Method Summary collapse
- #bing_pages ⇒ Object
-
#initialize(url) ⇒ Bing
constructor
A new instance of Bing.
Constructor Details
#initialize(url) ⇒ Bing
Returns a new instance of Bing.
9 10 11 12 |
# File 'lib/seo_params/bing.rb', line 9 def initialize(url) @url = url @response = Nokogiri::HTML(open("http://www.bing.com/search?q=site:#{url}")) end |
Instance Method Details
#bing_pages ⇒ Object
14 15 16 17 |
# File 'lib/seo_params/bing.rb', line 14 def bing_pages index = @response.css("span.sb_count").first.text.to_s[/[\d,]+/].delete! "," index.to_i end |