lib/plagiarism/strategries/bing.rb in plagiarism2-0.0.5 vs lib/plagiarism/strategries/bing.rb in plagiarism2-0.0.6
- old
+ new
@@ -7,14 +7,14 @@
def fetch(content, params)
Typhoeus.get(URL, params: params.merge('$format' => :json, 'Query' => "'#{content}'"), userpwd: ":#{Config.bing_key}")
end
- def exists?(response)
+ def iterate(response)
results = JSON.parse(response)['d']['results'] rescue []
results.all? do |r|
uri = URI.parse URI::encode(r['Url'])
- uri.host =~ whitelists_regex
+ yield uri
end
end
end