Fastbot.php 1017 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, \App\MetaGer $metager)
11
	{
12
13
14
15
16
17
		parent::__construct($engine, $mh, $metager);
		if ( strpos($this->urlEncode($metager->getEingabe()), "%") !== FALSE )
		{
			$this->removeCurlHandle($mh);
			return FALSE;
		}
18
19
20
21
	}

	public function loadResults ()
	{
22
		$result = utf8_encode(curl_multi_getcontent($this->ch));
23
24
25
26
27
28
29
30
31
		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, "\""));
32
				$this->results[] = new \App\Models\Result(
33
34
35
					trim(strip_tags($result[1])),
					$link,
					$result[3],
36
37
					$result[2],
					"<a href=\"http://www.fastbot.de\">fastbot</a>"
38
39
40
41
					);
			}
			
		}
42

43
44
	}
}