Beammachine.php 996 Bytes
Newer Older
1
2
3
<?php

namespace app\Models\parserSkripte;
4

5
6
use App\Models\Searchengine;

7
class Beammachine extends Searchengine
8
{
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    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;
            }
            $title       = $res[0];
            $link        = $res[1];
            $anzeigeLink = $link;
            $descr       = $res[2];

            $this->counter++;
            $this->results[] = new \App\Models\Result(
                $this->engine,
                $title,
                $link,
                $anzeigeLink,
                $descr,
                $this->gefVon,
                $this->counter
            );
        }

    }
43
}