class Plagiarism::Strategies::Yahoo

Constants

URL

Public Class Methods

fetch(content, params) click to toggle source
# File lib/plagiarism/strategries/yahoo.rb, line 8
def fetch(content, params)
  Typhoeus.get(URL, params: params.merge(p: content))
end
iterate(response, action = :all?) { |uri| ... } click to toggle source
# File lib/plagiarism/strategries/yahoo.rb, line 12
def iterate(response, action = :all?)
  doc = Nokogiri::HTML response
  doc.css('.searchCenterMiddle li .compTitle a').send(action) do |row|
    href = row.attributes['href'].value
    uri = URI.parse URI::encode(href)
    yield uri
  end
end