Class: SeoParams::Bing

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

Instance Method Summary collapse

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_pagesObject



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