Zeitde.php 845 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

namespace app\Models\parserSkripte;
use App\Models\Searchengine;

class Zeitde extends Searchengine 
{
	public $results = [];

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

15
	public function loadResults ($result)
16
17
18
	{
		
		$results = json_decode($result);
19
20
		if(!$results)
			return;
21
22
		foreach( $results->{"matches"} as $result )
		{
23
24
			if( !isset($result->{"title"}) || !isset($result->{"href"}) || !isset($result->{"snippet"}))
				continue;
25
26
27
28
29
30
31
			$title = $result->{"title"};
			$link = $result->{"href"};
			$anzeigeLink = $link;
			$descr = $result->{"snippet"};

			$this->counter++;
			$this->results[] = new \App\Models\Result(
32
				$this->engine,
33
34
35
36
37
38
39
40
41
42
43
44
45
				$title,
				$link,
				$anzeigeLink,
				$descr,
				$this->gefVon,
				$this->counter
			);		
		}
		

		
	}
}