Skip to content
Snippets Groups Projects
Commit a2d6eeaf authored by Davide Aprea's avatar Davide Aprea
Browse files

finish loadResults function for dummy parser

parent b7ad573e
Branches
No related tags found
3 merge requests!1895Development,!1775Development,!1765Resolve "add dummy-engine to docker installation"
......@@ -17,6 +17,36 @@ class Dummy extends Searchengine
public function loadResults($result)
{
return;
try {
$content = json_decode($result);
if (!$content) {
return;
}
foreach ($content as $result) {
try {
$title = $result->titel;
$link = $result->link;
$anzeigeLink = $link;
$descr = $result->descr;
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},$this->engine->homepage,
$this->counter
);
} catch (\ErrorException $e) {
}
}
} catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:");
Log::error($e->getMessage());
return;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment