Automation init...3
This commit is contained in:
parent
07bf39944a
commit
ccbe3ba17b
@ -34,23 +34,19 @@ class YamapController extends CommonController
|
|||||||
if (!count($items)) {
|
if (!count($items)) {
|
||||||
throw new \Exception("Yamap 사이트에서 게시물이 존재하지 않습니다.");
|
throw new \Exception("Yamap 사이트에서 게시물이 존재하지 않습니다.");
|
||||||
}
|
}
|
||||||
$max_limit = intval(getenv("yamap.list.item.max_limit"));
|
|
||||||
$max_limit = count($items) <= $max_limit ? $items : $max_limit;
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
if ($i <= $max_limit) {
|
try {
|
||||||
try {
|
//3. DetailPage 처리 : bbs_view > div.contents 가진 객체를 찾아서 처리
|
||||||
//3. DetailPage 처리 : bbs_view > div.contents 가진 객체를 찾아서 처리
|
$fileEntitys = $crawler->detailPage($item["detail_url"]);
|
||||||
$fileEntitys = $crawler->detailPage($item["detail_url"]);
|
//4.망보드 일반게시판에 게시물 등록 처리
|
||||||
//4.망보드 일반게시판에 게시물 등록 처리
|
if (count($fileEntitys)) {
|
||||||
if (count($fileEntitys)) {
|
$crawler->createBoard($item, $fileEntitys);
|
||||||
$crawler->createBoard($item, $fileEntitys);
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
log_message("notice", "게시물 {$i}번째 {$item["nickname"]} 작업완료.");
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
log_message("debug", $e->getMessage());
|
|
||||||
}
|
}
|
||||||
|
$i++;
|
||||||
|
log_message("notice", "게시물 {$i}번째 {$item["nickname"]} 작업완료.");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
log_message("debug", $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log_message("notice", "Crawler->" . __FUNCTION__ . " 작업이 완료되었습니다.");
|
log_message("notice", "Crawler->" . __FUNCTION__ . " 작업이 완료되었습니다.");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user