getMySocket()->getContent($listInfo['detail_url']); return array($this->getSelector($response, getenv("yamap.view.content.tag")), $listInfo); } //리스트내용 //
//
요즘 패션
//
// // 괴강고귀 // // // | 추천 (14) | 조회 (432) // //
//
// // // // 2024-09-14 01:53:45 // //
//
//
//

//

 

//
//
//
// // //
//
//
final public function execute(string $board_name, string $user_id = null, ...$params): void { try { //추가옵션 $this->isDebug = in_array('debug', $params); $this->isCopy = in_array('copy', $params); $this->setBoardName($board_name); $this->login_process($user_id); if ($this->isDebug) { $listInfo = []; $listInfo['title'] = 'test_title'; $listInfo['nickname'] = 'test_name'; $listInfo['hit'] = 1; $listInfo['date'] = date("Y-m-d H:i:s"); $listInfo['detail_url'] = getenv("yamap.view.test.url.{$this->getBoardName()}"); $listInfos[] = $listInfo; } else { $response = $this->getMySocket()->getContent(getenv("yamap.list.url.{$this->getBoardName()}")); $selector = $this->getSelector($response, getenv("yamap.list.tag.{$this->getBoardName()}")); $selector->filter(getenv("yamap.list.item.tag.{$this->getBoardName()}"))->each( function (Crawler $node) use (&$listInfos): void { $hit = $node->filter(getenv("yamap.list.item.hit.tag"))->text(); $date = $node->filter(getenv("yamap.list.item.date.tag"))->text(); $nickname = $node->filter(getenv("yamap.list.item.nickname.tag"))->text(); //bbs_item에서 span.g_nickname 객체를 찾아서 작성자가 "관리자" 아닌지 확인 후 Return Bool if ($nickname != getenv("yamap.list.item.nickname.except")) { //작성자가 "관리자"가 아닌 게시물이면 해당 bbs_item에서 a.list_subject 객체를 찾아서 $link_node = $node->filter(getenv("yamap.list.item.link.tag")); $detail_url = $link_node->attr("href"); $title = $link_node->children()->last()->text(); $listInfos[] = ['title' => $title, 'nickname' => $nickname, 'detail_url' => $detail_url, 'date' => $date, 'hit' => $hit]; } } ); } if (!count($listInfos)) { throw new \Exception("Target URL이 없습니다."); } $this->list_process(intval(getenv("yamap.list.max_limit.{$this->getBoardName()}")), $listInfos); log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); } catch (\Exception $e) { log_message("warning", sprintf( "\n---%s 오류---\n%s\n-----------------------------------------\n", __FUNCTION__, $e->getMessage() )); } } }