first commit

This commit is contained in:
2026-01-25 18:18:09 +08:00
commit 509312e604
8136 changed files with 2349298 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?php
namespace app\models\logics\commands\base;
use app\common\CurlApp;
class BaseCommandSpiderLogic
{
protected ?CurlApp $curl = null;
protected string $brandName = '';
protected string $baseUrl = '';
public function __construct()
{
ini_set('pcre.backtrack_limit', '-1');
$this->curl = new CurlApp();
}
public function exec()
{
$url = rtrim($this->baseUrl, '/') . '/fashion-shows/designer/' . $this->brandName;
// var_dump($url);
// list($request, $httpCode) = $curl->setUrl($url)->exec();
$request = $this->curl->setUrl($url)->exec();
if ($request) {
preg_match_all('/window.__PRELOADED_STATE__ = ([\s\S]*?);<\/script>/', $request, $matches);
$val = json_decode(current(end($matches)), true);
return $val['transformed']['runwayDesignerContent']['designerCollections'] ?? [];
} else {
// $this->logger->info('未找到数据.');
return [];
}
}
}