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

try catch for qualigo

parent ddce258b
No related branches found
No related tags found
2 merge requests!1502Development,!1496Resolve "Use a proxy"
...@@ -14,23 +14,29 @@ class Qualigo extends XmlSearchengine ...@@ -14,23 +14,29 @@ class Qualigo extends XmlSearchengine
protected function loadXmlResults($resultsXml) protected function loadXmlResults($resultsXml)
{ {
$results = $resultsXml->xpath('//RL/RANK'); try {
foreach ($results as $result) { $results = $resultsXml->xpath('//RL/RANK');
$title = $result->{"TITLE"}->__toString(); foreach ($results as $result) {
$link = $result->{"URL"}->__toString(); $title = $result->{"TITLE"}->__toString();
$anzeigeLink = $result->{"ORIGURL"}->__toString(); $link = $result->{"URL"}->__toString();
$descr = $result->{"ABSTRACT"}->__toString(); $anzeigeLink = $result->{"ORIGURL"}->__toString();
$this->counter++; $descr = $result->{"ABSTRACT"}->__toString();
$this->ads[] = new \App\Models\Result( $this->counter++;
$this->engine, $this->ads[] = new \App\Models\Result(
$title, $this->engine,
$link, $title,
$anzeigeLink, $link,
$descr, $anzeigeLink,
$this->engine->{"display-name"}, $descr,
$this->engine->homepage, $this->engine->{"display-name"},
$this->counter $this->engine->homepage,
); $this->counter
);
}
} catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:");
Log::error($e->getMessage());
return;
} }
} }
......
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