Fastbot.php 883 Bytes
Newer Older
1
2
<?php

3
4
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
5
6
7
8
9

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

10
	function __construct (\SimpleXMLElement $engine, $mh, $query, $time)
11
	{
12
		parent::__construct($engine, $mh, $query, $time);
13
14
15
16
	}

	public function loadResults ()
	{
17
		$result = utf8_encode(curl_multi_getcontent($this->ch));
18
19
20
21
22
23
24
25
26
		foreach( explode("\n", $result) as $line )
		{
			$line = trim($line);
			if( strlen($line) > 0 ){
				# Hier bekommen wir jedes einzelne Ergebnis
				$result = explode("|:|", $line);
				$link = $result[1];
				$link = substr($link, strpos($link, "href=\"") + 6);
				$link = substr($link, 0, strpos($link, "\""));
27
				$this->results[] = new \App\Models\Result(
28
29
30
					trim(strip_tags($result[1])),
					$link,
					$result[3],
31
32
					$result[2],
					"<a href=\"http://www.fastbot.de\">fastbot</a>"
33
34
35
36
					);
			}
			
		}
37

38
39
	}
}