Commit 17b3522f authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch...

Merge branch '210-yandex-suche-liefert-immer-mehr-ergebnisse-auch-wenn-es-tatsachlich-gar-keine-mehr-gibt' into 'development'

Yandex dürfte nur noch so lange weitersuchen, wie es auch neue Ergebnisse hat

Closes #210

See merge request !332
parents 711bbac4 0c7e80b3
......@@ -54,7 +54,17 @@ class Yandex extends Searchengine
public function getNext(\App\MetaGer $metager, $result)
{
if (count($this->results) <= 0) {
# Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt:
try {
$content = simplexml_load_string($result);
$resultCount = intval($content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]')[0]->__toString());
$pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0];
$pageLast = intval($pageLast["last"]->__toString());
} catch (\Exception $e) {
return;
}
if (count($this->results) <= 0 || $pageLast >= $resultCount) {
return;
}
......
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