Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!312Development,!309Der Hashwert für die folgenden Ergebnisse wurde noch nicht richtig gesetzt wodur…
...@@ -87,6 +87,7 @@ class Overture extends Searchengine ...@@ -87,6 +87,7 @@ class Overture extends Searchengine
# Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings: # Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings:
$last = new Overture(simplexml_load_string($this->engine), $metager); $last = new Overture(simplexml_load_string($this->engine), $metager);
$last->getString = preg_replace("/&Keywords=.*?&/si", "&", $last->getString) . "&" . $lastArgs; $last->getString = preg_replace("/&Keywords=.*?&/si", "&", $last->getString) . "&" . $lastArgs;
$last->hash = md5($last->host . $last->getString . $last->port . $last->name);
$this->last = $last; $this->last = $last;
} }
...@@ -114,6 +115,7 @@ class Overture extends Searchengine ...@@ -114,6 +115,7 @@ class Overture extends Searchengine
# Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings: # Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings:
$next = new Overture(simplexml_load_string($this->engine), $metager); $next = new Overture(simplexml_load_string($this->engine), $metager);
$next->getString = preg_replace("/&Keywords=.*?&/si", "&", $next->getString) . "&" . $nextArgs; $next->getString = preg_replace("/&Keywords=.*?&/si", "&", $next->getString) . "&" . $nextArgs;
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next; $this->next = $next;
} }
} }
...@@ -54,19 +54,25 @@ class Yandex extends Searchengine ...@@ -54,19 +54,25 @@ class Yandex extends Searchengine
public function getLast(\App\MetaGer $metager, $result) public function getLast(\App\MetaGer $metager, $result)
{ {
if( $metager->getPage() <= 1 ) if ($metager->getPage() <= 1) {
return; 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; $this->last = $last;
} }
public function getNext(\App\MetaGer $metager, $result) public function getNext(\App\MetaGer $metager, $result)
{ {
if( count($this->results) <= 0 ) if (count($this->results) <= 0) {
return; 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->getString .= "&page=" . ($metager->getPage() + 1);
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next; $this->next = $next;
} }
} }
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