Nebel.php 1011 Bytes
Newer Older
1
2
3
<?php

namespace app\Models\parserSkripte;
4

5
6
use App\Models\Searchengine;

7
class Nebel extends Searchengine
8
{
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    public $results = [];

    public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager)
    {
        parent::__construct($engine, $metager);
    }

    public function loadResults($result)
    {
        $results = trim($result);
        foreach (explode("\n", $results) as $result) {
            $res = explode("|", $result);
            if (sizeof($res) < 3) {
                continue;
            }

Dominik Hebeler's avatar
Dominik Hebeler committed
25
            $title       = $res[1];
26
27
            $link        = $res[0];
            $anzeigeLink = $link;
Dominik Hebeler's avatar
Dominik Hebeler committed
28
            $descr       = $res[2];
29
30
31
32
33
34
35
36

            $this->counter++;
            $this->results[] = new \App\Models\Result(
                $this->engine,
                $title,
                $link,
                $anzeigeLink,
                $descr,
37
                $this->displayName,$this->homepage,
38
39
40
41
42
43
                $this->counter
            );
        }

    }
}