echo "-【<font color='red'>章节“" . $title . "”连续3次都采集不到内容,等待重试</font>】<br>"; } $treid2 = 'b'; break 2; } else { $eorid = 0; } } else { $dsql->ExecuteNoneQuery("Update `#@__co_htmls` set isdown=0,isexport=0,result='' where aid='{$exid}' "); echo "-【<font color='red'>章节“" . $title . "”内容是空的,重新采集</font>】<br>"; break; } } } $title = addslashes($title); $title1 = str_replace($replacearray, '', reveser_c($title)); if ($only) { $testrow = $dsql->GetOne("Select a.id,b.body From `#@__archives` a left join `#@__addonarticle` b on(b.aid=a.id) where REVERSE(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(a.title,' ',''),'!',''),'!',''),',',''),'?',''),'(',''),')',''),'?',''),'(',''),')',''),'。',''),':',''),':',''),'.',''),'[',''),']',''),'【',''),'】','')) like '{$title1}%' and a.typeid='{$typeid}'"); if (is_array($testrow)) { $taid = $testrow['id']; $tbody = $testrow['body']; if ($tbody != "") { $dsql->ExecuteNoneQuery("update `#@__co_htmls` set isexport=1 where aid='{$exid}' "); echo " 【<font color='red'>重复2 {$title}</font>】<br>"; continue; } else { $dsql->ExecuteNoneQuery("update `#@__addonarticle` set body='{$body}' where aid='{$taid}' "); $dsql->ExecuteNoneQuery("update `#@__co_htmls` set isexport=1 where aid='{$exid}' "); echo " 【<font color='green'>已更新 {$title}</font>】<br>"; continue; }
$dsql->ExecuteNoneQuery("Update `#@__co_note` set cotime='" . time() . "' where nid='{$nid}'; "); include_once dirname(__FILE__) . "/../../include/dedecollection.spider.php"; //剔除已经20天没有采集到内容的规则 if ($nidcon == '0' and $channelid == 1 and $booksum2 > 1 and ${$cotype} > 0) { preg_match_all('/typeid=>([0-9]+)]/', $listconfig2, $tidarr); $co_stopnonupdate = intval($co_stopnonupdate) >= 0 ? intval($co_stopnonupdate) : 20; $curtime = time() - $co_stopnonupdate * 86400; //长时间没有更新的小说自动停止采集 for ($a = 0; $a < count($tidarr[1]); $a++) { $endrow = $dsql->GetOne("SELECT a.id,a.typename,FROM_UNIXTIME(a.lastupdate) AS lastt FROM dede_arctype a WHERE a.id=" . $tidarr[1][$a] . " and a.lastupdate<{$curtime}"); if (is_array($endrow)) { echo "【<font color='red'>" . $endrow['typename'] . "[" . $endrow['id'] . "]->" . $endrow['lastt'] . "</font>】->"; $tid2 = reveser_c('=>' . $tidarr[1][$a] . ']'); $tidlen = strlen($tid2); $listconfig3 = reveser_c($listconfig2); $addco_note = reveser_c(substr($listconfig3, stripos($listconfig3, $tid2), stripos($listconfig3, '[', stripos($listconfig3, $tid2)) - stripos($listconfig3, $tid2) + 1)); $row = $dsql->GetOne("Select * From `#@__co_note` where nid='{$nid}' and booksum>1"); if ($row) { foreach ($row as $k => $v) { ${$k} = addslashes($v); } //有完本字眼的就删除这条规则 $newbooksum = $booksum - 1; $replacetname = "+" . $endrow['typename']; $newnotename = str_replace($replacetname, '', $notename); $newlistconfig = str_replace($replacetname, '', str_replace($addco_note, '', $listconfig)); $updatesql = "update `#@__co_note` set notename='{$newnotename}',listconfig='{$newlistconfig}',booksum={$newbooksum} where nid={$nid}"; if ($dsql->ExecuteNoneQuery($updatesql)) { $renid = str_replace('-2', '-1', $renid); if (strstr($notename, '+')) { $nidtype = "+";