Sha256: ff393736f14cda59f1fbd1125662a19fae398c3ffb20a54acde8380e3fa4d167
Contents?: true
Size: 578 Bytes
Versions: 4
Compression:
Stored size: 578 Bytes
Contents
module Plagiarism module Strategies class Yahoo < Engine URL = 'https://search.yahoo.com/search' class << self def fetch(content, params) Typhoeus.get(URL, params: params.merge(p: content)) end 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 end end end end
Version data entries
4 entries across 4 versions & 1 rubygems