simplified the process of adding more search sites
This commit is contained in:
@@ -69,4 +69,8 @@ class TPB extends searchBase implements searchInterface
|
||||
$this->rows = $this->parse();
|
||||
return $this;
|
||||
}
|
||||
public static function getLabel(): string
|
||||
{
|
||||
return 'thepiratebay';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,4 +80,8 @@ class bitSearch extends searchBase implements searchInterface
|
||||
$this->rows = $this->parse();
|
||||
return $this;
|
||||
}
|
||||
public static function getLabel(): string
|
||||
{
|
||||
return 'bitsearch';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ abstract class searchBase
|
||||
protected $rows = [];
|
||||
protected $errors = [];
|
||||
protected $actionLinks = [["name" => 'download', 'path' => '/index.php/apps/ncdownloader/new'], ['name' => 'clipboard']];
|
||||
private static $instance = null;
|
||||
|
||||
public function getTableTitles(): array
|
||||
{
|
||||
@@ -18,6 +19,16 @@ abstract class searchBase
|
||||
return $this->tableTitles;
|
||||
}
|
||||
|
||||
public static function create($crawler,$client)
|
||||
{
|
||||
|
||||
if (!self::$instance) {
|
||||
self::$instance = new static($crawler,$client);
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function setTableTitles(array $titles)
|
||||
{
|
||||
$this->tableTitles = $titles;
|
||||
|
||||
@@ -10,10 +10,12 @@ class sliderkz extends searchBase implements searchInterface
|
||||
public $baseUrl = "https://slider.kz/vk_auth.php";
|
||||
protected $query = null;
|
||||
protected $tableTitles = [];
|
||||
public function __construct($client)
|
||||
|
||||
public function __construct($crawler,$client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
public function search(string $keyword): array
|
||||
{
|
||||
$this->query = ['q' => trim($keyword)];
|
||||
@@ -69,4 +71,9 @@ class sliderkz extends searchBase implements searchInterface
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public static function getLabel(): string
|
||||
{
|
||||
return 'music';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user