<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("视频分类转换管理");
switch ($action) {
    case "save":
        save();
        break;
    case "del":
        del();
        break;
    default:
        main();
}
function save()
{
    global $db;
    $c_id = be("arr", "c_id");
    $ids = explode(",", $c_id);
    if (!isN($c_id)) {
        foreach ($ids as $id) {
            $c_name = be("post", "c_name" . $id);
            $c_toid = be("post", "c_toid" . $id);
            $c_pid = be("post", "c_pid" . $id);
            $sql = "update {pre}cj_change set c_name='" . $c_name . "',c_toid='" . $c_toid . "',c_pid='" . $c_pid . "' where c_id=" . $id;
            $db->query($sql);
        }
    } else {
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "MovieType.php";
require_once "collect_vod_cjVideoUrl.php";
require_once "tools/ContentManager.php";
require_once "BaiduParse.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("视频自定义采集项目管理");
switch (trim($action)) {
    case "add":
    case "edit":
        edit();
        break;
    case "editstep1":
        editstep1();
        break;
    case "editstep2":
        editstep2();
        break;
    case "lastsave":
        lastsave();
        break;
    case "saveok":
        saveok();
        break;
    case "del":
        del();
        break;
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("文章过滤转换管理");
switch (trim($action)) {
    case "add":
    case "edit":
        edit();
        break;
    case "save":
        save();
        break;
    case "del":
        del();
        break;
    case "sflag":
        setflag();
        break;
    default:
        main();
        break;
}
function save()
{
    global $db;
    $f_id = be("post", "f_id");
    $f_name = be("post", "f_name");
    $f_object = be("post", "f_object");
<?php

/**
 * Created by PhpStorm.
 * User: yangliu
 * Date: 14-2-18
 * Time: 下午3:11
 */
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "api_collect_youku_cj.php";
headAdminCollect("优酷视频采集");
define("VIDEOS", "https://openapi.youku.com/v2/shows/videos.json?client_id=715115c589f8533a&show_id={id}&page=1&count={count}");
define("SHOWINFO", "https://openapi.youku.com/v2/shows/show.json?client_id=715115c589f8533a&show_id={id}");
$action = be("get", "action");
$contentparmStart = "showid_en=\"";
$contentparaend = "\";";
if (isset($action) && $action === 'collectSimpl') {
    $type_id = be("all", "type_id");
    $web_url = be("all", "web_url");
    $site_url = be("all", "site_url");
    $id = '';
    if (!isN($web_url)) {
        $content = getPage($web_url, 'utf-8');
        $id = getBody($content, $contentparmStart, $contentparaend);
    } else {
        if (!isN($site_url) && preg_match('/id_z(\\w.+?).html/', $site_url)) {
            $ids = preg_match_all('/id_z(\\w.+?).html/', $site_url, $match);
            $id = $match[1][0];
        } else {
            errmsg("采集提示", "采集信息不能为空");
<?php

ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "MovieType.php";
require_once "BaiduParse.php";
require_once "tools/ContentManager.php";
//chkLogin();
$action = be("get", "action");
headAdminCollect("视频自定义采集");
$p_ids = be("all", "p_id");
//if (isN($p_id)){
//	$p_ids = be("all","p_id");
//}
$num = be("get", "num");
$listnum = be("get", "listnum");
$viewnum = be("get", "viewnum");
$sb = be("get", "sb");
$cg = be("get", "cg");
$reCollExistMovie = true;
$collExiM = be("all", "ignoreExistM");
if (!isN($collExiM)) {
    $reCollExistMovie = false;
}
writetofile("crawel_info.log", $p_id . '{=====}' . $listnum . "{=====}Project===start");
if (isn($num)) {
    $num = 0;
} else {
    $num = intval($num);
Example #6
0
<?php

require_once "../admin_conn.php";
require_once dirname(__FILE__) . "/../tools/MailUtils.php";
require_once "collect_fun.php";
require_once "MovieType.php";
//chkLogin();
$action = be("all", "action");
headAdminCollect("视频采集入库管理");
switch ($action) {
    case "edit":
        edit();
        break;
    case "editsave":
        editsave();
        break;
    case "del":
        del();
        break;
    case "delpl":
        delpl();
        break;
    case "delall":
        delall();
        break;
    case "delurl":
        delurl();
        break;
    case "IDInflow":
        IDInflow();
        break;
<?php

ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
//chkLogin();
$action = be("get", "action");
headAdminCollect("文章自定义采集");
$p_ids = be("get", "p_id");
var_dump($p_ids);
$num = be("get", "num");
$listnum = be("get", "listnum");
$viewnum = be("get", "viewnum");
$sb = be("get", "sb");
$cg = be("get", "cg");
$users = getUsers();
$maxPostid = getMax('discuzforum_post_tableid', 'pid');
$maxThreadid = getMax('discuzforum_thread', 'tid');
$maxarticleid = getMax("discuzportal_article_title", "aid");
$sql = "SELECT count(*) FROM discuzcommon_member where uid !=1";
$maxUser = $db->getOne($sql);
if (isn($num)) {
    $num = 0;
} else {
    $num = intval($num);
}
if (isN($listnum)) {
    $listnum = 0;
} else {
    $listnum = intval($listnum);
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("视频过滤转换管理");
switch (trim($action)) {
    case "add":
    case "edit":
        edit();
        break;
    case "save":
        save();
        break;
    case "del":
        del();
        break;
    case "sflag":
        setflag();
        break;
    default:
        main();
        break;
}
function save()
{
    global $db;
    $f_id = be("post", "f_id");
    $f_name = be("post", "f_name");
    $f_object = be("post", "f_object");
function save()
{
    global $db, $cache, $action;
    //1
    $p_id = be("all", "p_id");
    $p_name = be("post", "p_name");
    $p_coding = be("post", "p_coding");
    $p_pagetype = be("post", "p_pagetype");
    $p_url = be("post", "p_url");
    $p_pagebatchurl = be("post", "p_pagebatchurl");
    $p_manualurl = be("post", "p_manualurl");
    $p_pagebatchid1 = be("post", "p_pagebatchid1");
    $p_pagebatchid2 = be("post", "p_pagebatchid2");
    $p_collecorder = be("post", "p_collecorder");
    $p_savefiles = be("post", "p_savefiles");
    $p_ontime = be("post", "p_ontime");
    $p_hitsstart = be("post", "p_hitsstart");
    $p_hitsend = be("post", "p_hitsend");
    $p_showtype = be("post", "p_showtype");
    $p_script = be("arr", "p_script");
    $sarr = explode(",", $p_script);
    $p_script = 0;
    foreach ($sarr as $s) {
        if (!isN($s)) {
            $p_script = $p_script | intval($s);
        }
    }
    if (isN($p_collecorder)) {
        $p_collecorder = 0;
    }
    if (isN($p_savefiles)) {
        $p_savefiles = 0;
    }
    if (isN($P_IntoLib)) {
        $P_IntoLib = 0;
    }
    if (isN($p_ontime)) {
        $p_ontime = 0;
    }
    if (isN($p_server)) {
        $p_server = 0;
    }
    if (!isNum($p_pagebatchid1)) {
        $p_pagebatchid1 = 1;
    }
    if (!isNum($p_pagebatchid2)) {
        $p_pagebatchid2 = 1;
    }
    //2
    $p_listcodestart = be("post", "p_listcodestart");
    $p_listcodeend = be("post", "p_listcodeend");
    $p_listlinkstart = be("post", "p_listlinkstart");
    $p_listlinkend = be("post", "p_listlinkend");
    $p_titletype = be("post", "p_titletype");
    $p_authortype = be("post", "p_authortype");
    if (isN($p_authortype)) {
        $p_authortype = 0;
    } else {
        $p_authortype = intval($p_authortype);
    }
    if (isN($p_titletype)) {
        $p_titletype = 0;
    } else {
        $p_titletype = intval($p_titletype);
    }
    //3
    $p_timestart = be("post", "p_timestart");
    $p_timeend = be("post", "p_timeend");
    $p_classtype = be("post", "p_classtype");
    $p_collect_type = be("post", "p_collect_type");
    $p_typestart = be("post", "p_typestart");
    $p_typeend = be("post", "p_typeend");
    $p_contentstart = be("post", "p_contentstart");
    $p_contentend = be("post", "p_contentend");
    if (isN($p_collect_type)) {
        $p_collect_type = 0;
    }
    $strlisturl = be("post", "listurl");
    if ($p_authortype == 1) {
        $p_authorstart = be("post", "p_listauthorstart");
        $p_authorend = be("post", "p_listauthorend");
    } else {
        $p_authorstart = be("post", "p_authorstart");
        $p_authorend = be("post", "p_authorend");
    }
    if ($p_titletype == 1) {
        $p_titlestart = be("post", "p_listtitlestart");
        $p_titleend = be("post", "p_listtitleend");
    } else {
        $p_titlestart = be("post", "p_titlestart");
        $p_titleend = be("post", "p_titleend");
    }
    $strSet = "";
    if (isN($p_id)) {
        $sql = "INSERT {pre}cj_art_projects(p_time)  values ('" . date('Y-m-d H:i:s', time()) . "')";
        $db->query($sql);
        $p_id = $db->insert_id();
    }
    $strSet .= " p_name='" . $p_name . "',p_coding='" . $p_coding . "',p_pagetype='" . $p_pagetype . "',p_url='" . $p_url . "',p_pagebatchurl='" . $p_pagebatchurl . "',p_manualurl='" . $p_manualurl . "',p_pagebatchid1='" . $p_pagebatchid1 . "',p_pagebatchid2='" . $p_pagebatchid2 . "',p_script='" . $p_script . "',p_showtype='" . $p_showtype . "',p_collecorder='" . $p_collecorder . "',p_savefiles='" . $p_savefiles . "',p_ontime='" . $p_ontime . "',p_hitsstart='" . $p_hitsstart . "',p_hitsend='" . $p_hitsend . "',";
    $strSet .= "p_authorstart='" . $p_authorstart . "',p_authorend='" . $p_authorend . "',p_titlestart='" . $p_titlestart . "',p_titleend='" . $p_titleend . "',p_listcodestart='" . $p_listcodestart . "',p_listcodeend='" . $p_listcodeend . "',p_listlinkstart='" . $p_listlinkstart . "',p_listlinkend='" . $p_listlinkend . "',p_authortype='" . $p_authortype . "',p_titletype='" . $p_titletype . "',";
    $strSet .= "p_timestart='" . $p_timestart . "',p_timeend='" . $p_timeend . "',p_classtype='" . $p_classtype . "',p_collect_type='" . $p_collect_type . "',p_typestart='" . $p_typestart . "',p_typeend='" . $p_typeend . "',p_contentstart='" . $p_contentstart . "',p_contentend='" . $p_contentend . "'";
    $db->query("update {pre}cj_art_projects set " . $strSet . " where p_id=" . $p_id);
    if ($action == "save") {
        alertUrl("保存成功", "collect_art_manage.php");
    } else {
        headAdminCollect("文章自定义采集项目测试");
        if ($p_pagetype != 3) {
            if (isN($_SESSION["strListCodeart"])) {
                $strListCode = getPage($strlisturl, $p_coding);
                $_SESSION["strListCodeart"] = $strListCode;
            } else {
                $strListCode = $_SESSION["strListCodeart"];
            }
            if (isN($_SESSION["strListCodeCutart"])) {
                $strListCodeCut = getBody($strListCode, $p_listcodestart, $p_listcodeend);
                $_SESSION["strListCodeCutart"] = $strListCodeCut;
            } else {
                $strListCodeCut = $_SESSION["strListCodeCutart"];
            }
            if (isN($_SESSION["linkarrcodeart"])) {
                $linkarrcode = getArray($strListCodeCut, $p_listlinkstart, $p_listlinkend);
                $_SESSION["linkarrcodeart"] = $linkarrcode;
            } else {
                $linkarrcode = $_SESSION["linkarrcodeart"];
            }
            if ($p_authortype == 1) {
                $starringarr = getArray($strListCodeCut, $p_authorstart, $p_authorend);
            }
            if ($p_titletype == 1) {
                $titlearrcode = getArray($strListCodeCut, $p_titlestart, $p_titleend);
            }
            switch ($linkarrcode) {
                case False:
                    errmsg("采集提示", "<li>在获取链接列表时出错。</li>");
                    break;
                default:
                    $linkarr = explode("{Array}", $linkarrcode);
                    $UrlTest = $linkarr[0];
                    $UrlTest = definiteUrl($UrlTest, $strlisturl);
                    $linkcode = getPage($UrlTest, $p_coding);
                    break;
            }
        } else {
            $strlisturl = $p_pagebatchurl;
            $p_pagebatchurl = replaceStr($p_pagebatchurl, "{ID}", $p_pagebatchid1);
            $linkcode = getPage($p_pagebatchurl, $p_coding);
        }
        if ($p_titletype == 1) {
            switch ($titlearrcode) {
                case False:
                    $titlecode = "获取失败";
                    break;
                default:
                    $titlearr = explode("{Array}", $titlearrcode);
                    $titlecode = $titlearr[0];
                    break;
            }
        } else {
            $titlecode = getBody($linkcode, $p_titlestart, $p_titleend);
        }
        if ($p_authortype == 1) {
            switch ($titlearrcode) {
                case False:
                    $starringcode = "获取失败";
                    break;
                default:
                    $starringarr = explode("{Array}", $starringarrcode);
                    $starringcode = $starringarr[0];
                    break;
            }
        } else {
            $starringcode = getBody($linkcode, $p_authorstart, $p_authorend);
        }
        $timecode = getBody($linkcode, $p_timestart, $p_timeend);
        $timecode = replaceStr($timecode, "False", now);
        $contentcode = getBody($linkcode, $p_contentstart, $p_contentend);
        var_dump($contentcode);
        $contentcode = replaceStr($contentcode, "False", "未知");
        $contentcode = replaceFilters($contentcode, $p_id, 2, 1);
        if ($p_classtype == 1) {
            $typecode = getBody($linkcode, $p_typestart, $p_typeend);
        } else {
            $typecode = $p_collect_type;
            $typearr = getValueByArray($cache[1], "t_id", $typecode);
            $typecode = $typearr["t_name"];
        }
        $titlecode = filterScript($titlecode, $p_script);
        $titlecode = replaceFilters($titlecode, $p_id, 1, 1);
        $starringcode = filterScript($starringcode, $p_script);
        $timecode = filterScript($timecode, $p_script);
        $typecode = filterScript($typecode, $p_script);
        ?>
<table class="tb">
  	<tr>
	<td  colspan="2" align="center">保存规则并采集测试结果</td>
  	</tr>
    <tr>
	<td width="15%">标题:</td><td> <input type="text" size="50" name="d_name" value="<?php 
        echo $titlecode;
        ?>
" /> </td>
    </tr>
    <tr>
	<td>作者:</td><td> <input type="text" size="50" name="d_author" value="<?php 
        echo $starringcode;
        ?>
" /> </td>
    </tr>
    <tr>
	<td>日期:</td><td> <input type="text" size="50" name="d_time" value="<?php 
        echo $timecode;
        ?>
" /> </td>
    </tr>
    <tr>
	<td>栏目:</td><td> <input type="text" size="50" name="d_typename" value="<?php 
        echo $typecode;
        ?>
" /> </td>
    </tr>
    <tr>
	<td>内容:</td>
	<td> <div style="height:300px;overflow:hidden;overflow-y:auto;"><?php 
        echo $contentcode;
        ?>
 </div></td>
    </tr>
	<tr>
	<td colspan="2"><input type="button" onClick="window.location.href='javascript:history.go(-1)'" value="返回规则">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onClick="window.location.href='?action=main'" value="返回列表"></td>
	</tr>
</table>
<?php 
    }
}
Example #10
0
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("文章采集入库管理");
switch ($action) {
    case "edit":
        edit();
        break;
    case "editsave":
        editsave();
        break;
    case "del":
        del();
        break;
    case "delpl":
        delpl();
        break;
    case "delall":
        delAll();
        break;
    case "delurl":
        delurl();
        break;
    case "IDInflow":
        IDInflow();
        break;
    case "AllInflow":
        AllInflow();
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
chkLogin();
$action = be("get", "action");
headAdminCollect("文章分类转换管理");
switch ($action) {
    case "save":
        save();
        break;
    case "del":
        del();
        break;
    default:
        main();
}
function save()
{
    global $db;
    $c_id = be("arr", "c_id");
    $ids = explode(",", $c_id);
    if (!isN($c_id)) {
        foreach ($ids as $id) {
            $c_name = be("post", "c_name" . $id);
            $c_toid = be("post", "c_toid" . $id);
            $c_pid = be("post", "c_pid" . $id);
            $sql = "update {pre}cj_change set c_name='" . $c_name . "',c_toid='" . $c_toid . "',c_pid='" . $c_pid . "' where c_id=" . $id;
            $db->query($sql);
        }
    } else {