示例#1
0
<?php

require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . "/dedecollection.class.php";
if (!empty($nid)) {
    $ntitle = '采集指定节点:';
    $nid = intval($nid);
    $co = new DedeCollection();
    $co->LoadNote($nid);
    $row = $dsql->GetOne("Select count(aid) as dd From `#@__co_htmls` where nid='{$nid}'; ");
    if ($row['dd'] == 0) {
        $unum = "没有记录或从来没有采集过这个节点!";
    } else {
        $unum = "共有 {$row['dd']} 个历史种子网址!<a href='javascript:SubmitNew();'>[<u>更新种子网址,并采集</u>]</a>";
    }
} else {
    $ntitle = '监控式采集:';
    $unum = "没指定采集节点,将使用检测新内容采集模式!";
}
include DedeInclude('templets/co_gather_start.htm');
示例#2
0
}
if ($totalnum > $startdd + $pagesize) {
    $limitSql = " LIMIT {$startdd},{$pagesize} ";
} else {
    $limitSql = " LIMIT {$startdd}," . ($totalnum - $startdd);
}
if ($totalnum - $startdd < 1) {
    if (empty($nid)) {
        $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "'; ");
    } else {
        $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "' WHERE nid='{$nid}'; ");
    }
    ShowMsg('完成当前下载任务!', 'javascript:;');
    exit;
}
$co = new DedeCollection();
if (!empty($nid)) {
    $co->LoadNote($nid);
}
//没指定采集ID时下载所有内容
if (!empty($nid)) {
    $dsql->SetQuery("SELECT aid,nid,url,isdown,litpic FROM `#@__co_htmls` WHERE nid={$nid} {$limitSql} ");
} else {
    $dsql->SetQuery("SELECT aid,nid,url,isdown,litpic FROM `#@__co_htmls` {$limitSql} ");
}
$dsql->Execute(99);
$tjnum = $startdd;
while ($row = $dsql->GetObject(99)) {
    if ($row->isdown == 0) {
        if (empty($nid)) {
            $co->LoadNote($row->nid);
示例#3
0
     $notename = stripslashes($notename);
     if ($sourcetype == 'rss' && ($refurl = '')) {
         $refurl = $rssurl;
     }
     $refurl = stripslashes($refurl);
     $errmsg = '';
     //测试规则
     if ($sourcetype == 'rss') {
         $links = GetRssLinks(stripslashes($rssurl));
         $demopage = $rssurl;
     } else {
         $links = array();
         $lists = GetUrlFromListRule($regxurl, stripslashes($addurls), $startid, $endid, $addv, $usemore, stripslashes($batchrule));
         if (isset($lists[0][0])) {
             $demopage = $lists[0][0];
             $dc = new DedeCollection();
             $dc->LoadListConfig($tmplistconfig);
             $listurl = '';
             $links = $dc->Testlists($listurl);
             $errmsg = $dc->errString;
         } else {
             $demopage = '没有匹配到适合的列表页!';
         }
     }
     require_once DEDEADMIN . "/templets/co_add_step1_test.htm";
     exit;
 } else {
     $row = $dsql->GetOne("Select nid,channelid From `#@__co_note` where isok=0 And notename like '{$notename}' ");
     if (!is_array($row)) {
         $uptime = time();
         $listconfig = urldecode($listconfig);
            $nnid = $row['nid'];
            if (!is_array($row)) {
                ShowMsg("完成所有节点检测....", "co_gather_start_action.php?notckpic=0&sptime=0&nid=0&startdd=0&pagesize=5&totalnum=" . $totalnum);
                exit;
            } else {
                $co = new DedeCollection();
                $co->LoadNote($nnid);
                $limitList = $co->GetSourceUrl(1, 0, 100);
                $curpos++;
                ShowMsg("已检测节点( {$nnid} ),继续下一个节点...", $gurlList . "&curpos={$curpos}");
                exit;
            }
        }
    } else {
        $gurl = "co_gather_start_action.php?notckpic={$notckpic}&islisten={$islisten}&nid={$nid}&startdd={$startdd}&pagesize={$pagesize}&sptime={$sptime}";
        $gurlList = "co_getsource_url_action.php?islisten={$islisten}&nid={$nid}&startdd={$startdd}&pagesize={$pagesize}&sptime={$sptime}";
        $co = new DedeCollection();
        $co->LoadNote($nid);
        $limitList = $co->GetSourceUrl($islisten, $glstart, $pagesize);
        if ($limitList == 0) {
            $row = $co->dsql->GetOne("SELECT COUNT(aid) AS dd FROM `#@__co_htmls` WHERE nid='{$nid}'");
            $totalnum = $row['dd'];
            ShowMsg("已获得所有种子网址,转向网页采集...", $gurl . "&totalnum={$totalnum}");
            exit;
        }
        if ($limitList > 0) {
            ShowMsg("采集列表剩余:{$limitList} 个页面,继续采集...", $gurlList . "&glstart=" . ($glstart + $pagesize), 0, 100);
            exit;
        }
    }
}
<?php 
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_collection.php");
if($nid=="") 
{
	ShowMsg("参数无效!","-1");	
	exit();
}
$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
require_once(dirname(__FILE__)."/templets/co_test_rule.htm");
$co->Close();

ClearAllLink();
?>
示例#6
0
    $list = array();
    foreach (glob($path . '/*') as $item) {
        if (is_dir($item)) {
            $list = array_merge($list, clean_cachefiles($item));
        } else {
            $list[] = $item;
        }
    }
    foreach ($list as $tmpfile) {
        if ($tmpfile != "../data/tplcache/index.html") {
            @unlink($tmpfile);
        }
    }
    return true;
}
$co = new DedeCollection();
$co->LoadNote($nid);
$orderway = "desc";
$noco = 0;
$treid = 'a';
$treid2 = 'b';
$pretid = 'c';
$nn = 0;
$replacearray = array(" ", "!", "?", "?", "(", ")", "(", ")", "!", ",", ".", ":", "。", ":", "【", "】");
if ($channelid == 99) {
    $con1 = intval($co_novelcount) >= 0 ? intval($co_novelcount) : 1;
} elseif ($channelid == 98) {
    $con1 = intval($co_novelcount) >= 0 ? intval($co_novelcount) * 2 : 2;
} else {
    $con1 = intval($co_artcount) >= 0 ? intval($co_artcount) : 10;
}
		$k = $j+1;
		$surl = "co_gather_start_action.php?islisten=$islisten&thethr=$k&sptime=$sptime&nid=$nid&oldstart=$sdd&startdd=$sdd&totalnum=$totalnum&pagesize=$pagesize";
		echo "<iframe scrolling='no' name='thredfrm$j' frameborder='0' width='100%' height='200' src='$surl'></iframe>\r\n";
	}
	exit();
}
if($totalnum > $startdd+$pagesize) $limitSql = " limit $startdd,$pagesize";
else $limitSql = " limit $startdd,".($totalnum - $startdd);

if($totalnum - $startdd < 1){
	ShowMsg("完成当前下载任务!","javascript:;");
	$dsql->Close();
	exit();
}

$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
$co->dsql->SetQuery("Update #@__conote set lasttime='".time()."' where nid=$nid");
$co->dsql->ExecuteNoneQuery();
$co->dsql->SetQuery("Select aid,url From #@__courl where nid=$nid $limitSql");
$co->dsql->Execute(99);
$tjnum = $startdd;
while($row = $co->dsql->GetObject(99))
{
	$lrow = $co->dsql->GetOne("Select * From #@__co_listenurl where url like '".addslashes($row->url)."'");
	if(is_array($lrow)){
		if($islisten==0) continue;
	}
	else{
		$inquery = "INSERT INTO #@__co_listenurl(nid,url) VALUES ('$nid', '".addslashes($row->url)."');";
示例#8
0
    $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET result='{$result}' WHERE aid='{$aid}'; ");
    ShowMsg("成功保存一条记录!", $backurl);
    exit;
}
$dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='{$aid}'");
$dsql->Execute();
$row = $dsql->GetObject();
$isdown = $row->isdown;
$nid = $row->nid;
$url = $row->url;
$dtime = $row->dtime;
$body = $row->result;
$litpic = $row->litpic;
$fields = array();
if ($isdown == 0) {
    $co = new DedeCollection();
    $co->LoadNote($nid);
    $co->DownUrl($aid, $url, $litpic);
    $co->dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='{$aid}'");
    $co->dsql->Execute();
    $row = $co->dsql->GetObject();
    $isdown = $row->isdown;
    $nid = $row->nid;
    $url = $row->url;
    $dtime = $row->dtime;
    $body = $row->result;
    $litpic = $row->litpic;
}
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede", "{", "}");
$dtp->LoadString($body);
示例#9
0
}

$dsql = new DedeSql(false);
$dsql->SetSql("Select * from #@__courl where aid='$aid'");
$dsql->Execute();
$row = $dsql->GetObject();
$isdown = $row->isdown;
$nid = $row->nid;
$url = $row->url;
$dtime = $row->dtime;
$body = $row->result;
$dsql->Close();
$fields = array();
if($isdown==0)
{
	$co = new DedeCollection();
	$co->Init();
	$co->LoadFromDB($nid);
	$co->DownUrl($aid,$url);
	$co->dsql->SetSql("Select * from #@__courl where aid='$aid'");
	$co->dsql->Execute();
	$row = $co->dsql->GetObject();
	$isdown = $row->isdown;
	$nid = $row->nid;
	$url = $row->url;
	$dtime = $row->dtime;
	$body = $row->result;
	$co->Close();
}
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede","{","}");
}

if(empty($glstart)) $glstart = 0;
if(empty($totalnum)) $totalnum = 0;

$gurl = "co_gather_start_action.php?islisten=$islisten&nid=$nid&startdd=$startdd&pagesize=$pagesize&threadnum=$threadnum&sptime=$sptime";

$gurlList = "co_getsource_url_action.php?islisten=$islisten&nid=$nid&startdd=$startdd&pagesize=$pagesize&threadnum=$threadnum&sptime=$sptime";

if($totalnum>0)
{
	ShowMsg("当前节点已下载网页网址,程序直接转向网页采集...",$gurl."&totalnum=$totalnum");
	exit();
}

$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);

$limitList = $co->GetSourceUrl($islisten,$glstart,$pagesize);

if($limitList==0)
{
	$co->dsql->SetSql("Select count(aid) as dd From #@__courl where nid='$nid'");
  $co->dsql->Execute();
  $row = $co->dsql->GetObject();
  $totalnum = $row->dd;
	$co->Close();
	ShowMsg("已获得所有待下载网址,转向网页采集...",$gurl."&totalnum=$totalnum");
	exit();
}else if($limitList>0)