Skip to content

Instantly share code, notes, and snippets.

@kzaitsev
Created September 25, 2013 20:46
Show Gist options
  • Save kzaitsev/6705786 to your computer and use it in GitHub Desktop.
Save kzaitsev/6705786 to your computer and use it in GitHub Desktop.
doc = Nokogiri::HTML(body)
doc.encoding = 'utf-8'
tic = 0
pr = 0
doc.search('div.resp-analysis/div#box-basik').each do | yandex |
content = yandex
if content.to_s.include?('-- тИЦ --')
tic = yandex.search('div.row-fluid/div.span4/div.pull-right/a.black.bold.noun')[0].text.to_s.split(' ').join.to_i
end
end
doc.search('div.resp-analysis/div#box-basik').each do | google |
content = google
if content.to_s.include?('-- PR --')
unless google.search('div.row-fluid/div.span4/div.pull-right/b')[0].nil?
pr = google.search('div.row-fluid/div.span4/div.pull-right/b')[0].text.to_s.split('/')[0].to_i
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment