diff --git a/app/Controllers/Mangboard/CrawlerController.php b/app/Controllers/Mangboard/CrawlerController.php index 44be22e..9989cb9 100644 --- a/app/Controllers/Mangboard/CrawlerController.php +++ b/app/Controllers/Mangboard/CrawlerController.php @@ -104,7 +104,7 @@ class CrawlerController extends CommonController $crawler = new InvenCrawler(getenv("inven.host.url"), $board_name, $user_entity); $crawler->isDebug = in_array('debug', $params); $crawler->isCopy = in_array('copy', $params); - $crawler->execute(intval(getenv("inven.list.max_limit"))); + $crawler->execute(); return "완료되었습니다."; } catch (\Exception $e) { log_message("error", $e->getMessage()); diff --git a/app/Libraries/MyCrawler/Mangboard/InvenCrawler.php b/app/Libraries/MyCrawler/Mangboard/InvenCrawler.php index b34c785..a616eae 100644 --- a/app/Libraries/MyCrawler/Mangboard/InvenCrawler.php +++ b/app/Libraries/MyCrawler/Mangboard/InvenCrawler.php @@ -119,7 +119,7 @@ class InvenCrawler extends MangboardCrawler // // // - public function execute(int $max_limit): void + public function execute(): void { try { if ($this->isDebug) { @@ -134,7 +134,7 @@ class InvenCrawler extends MangboardCrawler } else { $listInfos = []; $response = $this->getMySocket()->getContent(getenv("inven.list.url.{$this->getBoardName()}")); - $this->getSelector($response, getenv("inven.list.tag"))->each( + $this->getSelector($response, getenv("inven.list.tag.{$this->getBoardName()}"))->each( function (Crawler $node) use (&$listInfos): void { $hit = $node->filter(getenv("inven.list.item.hit.tag"))->text(); $date = date("Y") . "-" . $node->filter(getenv("inven.list.item.date.tag"))->text(); @@ -149,7 +149,7 @@ class InvenCrawler extends MangboardCrawler if (!count($listInfos)) { throw new \Exception("Target URL이 없습니다."); } - $this->list_process($max_limit, $listInfos); + $this->list_process(intval(getenv("inven.list.max_limit.{$this->getBoardName()}")), $listInfos); } log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); } catch (\Exception $e) { diff --git a/app/Libraries/MyCrawler/Mangboard/MangboardCrawler.php b/app/Libraries/MyCrawler/Mangboard/MangboardCrawler.php index 0f1d8f7..f5e0455 100644 --- a/app/Libraries/MyCrawler/Mangboard/MangboardCrawler.php +++ b/app/Libraries/MyCrawler/Mangboard/MangboardCrawler.php @@ -26,7 +26,7 @@ abstract class MangboardCrawler extends MyCrawler $this->_user_entity = $user_entity; } abstract protected function detail_process(int $cnt, array $listInfo): array; - abstract public function execute(int $max_limit): void; + abstract public function execute(): void; final protected function getMySocket() { if ($this->_mySocket === null) { diff --git a/app/Libraries/MyCrawler/Mangboard/SirCrawler.php b/app/Libraries/MyCrawler/Mangboard/SirCrawler.php index 264a753..56564ce 100644 --- a/app/Libraries/MyCrawler/Mangboard/SirCrawler.php +++ b/app/Libraries/MyCrawler/Mangboard/SirCrawler.php @@ -139,7 +139,7 @@ class SirCrawler extends MangboardCrawler // 244 // // - public function execute(int $max_limit): void + public function execute(): void { try { if ($this->isDebug) { @@ -170,7 +170,7 @@ class SirCrawler extends MangboardCrawler if (!count($listInfos)) { throw new \Exception("Target URL이 없습니다."); } - $this->list_process($max_limit, $listInfos); + $this->list_process(intval(getenv("sir.list.max_limit")), $listInfos); } log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); } catch (\Exception $e) { diff --git a/app/Libraries/MyCrawler/Mangboard/YamapCrawler.php b/app/Libraries/MyCrawler/Mangboard/YamapCrawler.php index aa4fe9e..8e71518 100644 --- a/app/Libraries/MyCrawler/Mangboard/YamapCrawler.php +++ b/app/Libraries/MyCrawler/Mangboard/YamapCrawler.php @@ -65,7 +65,7 @@ class YamapCrawler extends MangboardCrawler // //
// - public function execute(int $max_limit): void + public function execute(): void { try { if ($this->isDebug) { @@ -100,7 +100,7 @@ class YamapCrawler extends MangboardCrawler if (!count($listInfos)) { throw new \Exception("Target URL이 없습니다."); } - $this->list_process($max_limit, $listInfos); + $this->list_process(intval(getenv("yamap.list.max_limit")), $listInfos); } log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); } catch (\Exception $e) { diff --git a/app/Libraries/MyCrawler/Mangboard/YamoonCrawler.php b/app/Libraries/MyCrawler/Mangboard/YamoonCrawler.php index f1786a2..6fa4fad 100644 --- a/app/Libraries/MyCrawler/Mangboard/YamoonCrawler.php +++ b/app/Libraries/MyCrawler/Mangboard/YamoonCrawler.php @@ -87,7 +87,7 @@ class YamoonCrawler extends MangboardCrawler // 6 // yeeyuu | 6 | 369 | No 89372 | 2024-09-13 // - public function execute(int $max_limit): void + public function execute(): void { try { if ($this->isDebug) { @@ -115,7 +115,7 @@ class YamoonCrawler extends MangboardCrawler if (!count($listInfos)) { throw new \Exception("Target URL이 없습니다."); } - $this->list_process($max_limit, $listInfos); + $this->list_process(intval(getenv("yamoon.list.max_limit")), $listInfos); } log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); } catch (\Exception $e) {