diff --git a/app/Models/parserSkripte/Dmoznebel.php b/app/Models/parserSkripte/Dmoznebel.php index c2113e8c7723b79f7e85178f1cf922cd91caa50c..961157bf78c778ce0623cc2fb620a81a457c7a96 100644 --- a/app/Models/parserSkripte/Dmoznebel.php +++ b/app/Models/parserSkripte/Dmoznebel.php @@ -15,22 +15,32 @@ class Dmoznebel extends Searchengine public function loadResults ($result) { - $title = ""; - $link = ""; - $anzeigeLink = $link; - $descr = ""; + $result = mb_convert_encoding($result, "UTF-8", "ISO-8859-1"); + $results = trim($result); + + foreach( explode("\n", $results) as $result ) + { + $res = explode("|", $result); + if(sizeof($res) < 3) + { + continue; + } + $title = $res[1]; + $link = $res[2]; + $anzeigeLink = $link; + $descr = $res[3]; - die($result); + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); } } \ No newline at end of file