Skip to content
Snippets Groups Projects
Commit 3bc11d90 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

logging failed yahoo searches

parent ff6d9921
No related branches found
No related tags found
3 merge requests!2027Development,!2026Development,!2025Resolve "Fix Yahoo results for non monetized queries"
......@@ -43,6 +43,7 @@ class Overture extends Searchengine
// There are cases where Yahoo will return empty responses
// when search terms are not monetized although websearch results should exist
$this->failed_results = true;
$this->log_failed_yahoo_search();
return;
}
......@@ -168,4 +169,20 @@ class Overture extends Searchengine
return "&affilData=" . $affilDataValue . "&serveUrl=" . $serveUrl;
}
private function log_failed_yahoo_search()
{
$log_file = storage_path("logs/metager/yahoo_fail.csv");
$data = [
"time" => now()->format("Y-m-d H:i:s"),
"query" => $this->query
];
$fh = fopen($log_file, "a");
try {
fputcsv($fh, $data);
} finally {
fclose($fh);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment