Commit 354910bf authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch...

Merge branch '182-wir-fragen-immer-nur-die-ersten-ergebnisse-einer-suchmaschine-ab' into 'development'

Der Hashwert für die folgenden Ergebnisse wurde noch nicht richtig gesetzt wodur…

…ch immer wieder die gleichen Ergebnisse erschienen sind
Closes #182

See merge request !309
parents ace0b50d 9854463d
......@@ -87,6 +87,7 @@ class Overture extends Searchengine
# Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings:
$last = new Overture(simplexml_load_string($this->engine), $metager);
$last->getString = preg_replace("/&Keywords=.*?&/si", "&", $last->getString) . "&" . $lastArgs;
$last->hash = md5($last->host . $last->getString . $last->port . $last->name);
$this->last = $last;
}
......@@ -114,6 +115,7 @@ class Overture extends Searchengine
# Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings:
$next = new Overture(simplexml_load_string($this->engine), $metager);
$next->getString = preg_replace("/&Keywords=.*?&/si", "&", $next->getString) . "&" . $nextArgs;
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next;
}
}
......@@ -54,19 +54,25 @@ class Yandex extends Searchengine
public function getLast(\App\MetaGer $metager, $result)
{
if( $metager->getPage() <= 1 )
if ($metager->getPage() <= 1) {
return;
$last = new Yandex(simplexml_load_string($this->engine), $metager);
$last->getString .= "&page=" . ($metager->getPage() -1 );
}
$last = new Yandex(simplexml_load_string($this->engine), $metager);
$last->getString .= "&page=" . ($metager->getPage() - 1);
$last->hash = md5($last->host . $last->getString . $last->port . $last->name);
$this->last = $last;
}
public function getNext(\App\MetaGer $metager, $result)
{
if( count($this->results) <= 0 )
if (count($this->results) <= 0) {
return;
$next = new Yandex(simplexml_load_string($this->engine), $metager);
}
$next = new Yandex(simplexml_load_string($this->engine), $metager);
$next->getString .= "&page=" . ($metager->getPage() + 1);
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment