本文整理匯總了PHP中ContentModel::getUrlList方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentModel::getUrlList方法的具體用法?PHP ContentModel::getUrlList怎麽用?PHP ContentModel::getUrlList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContentModel
的用法示例。
在下文中一共展示了ContentModel::getUrlList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
// 默認超時
set_time_limit(0);
// 定義應用目錄
define('APP', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
// 載入框架引導文件
require APP . 'system/_shell.php';
require APP . 'funcs/spider.fn.php';
require APP . 'funcs/ecshop.fn.php';
require APP . 'models/ContentModel.php';
require APP . 'et/phpQuery/phpQuery.php';
echo "開始獲取隊列\n";
$table_name = 'spider_ecshop_url';
$contentModel = new ContentModel();
$configs = array('need_push' => 'yes');
$url_list = $contentModel->getUrlList($configs, 'LIMIT 15000 ', $table_name);
$url_count = count($url_list);
echo "獲取到{$url_count}條要采集的內容... \n";
if (!empty($url_list)) {
// $url_info = get_line(prepare('select * from task_list where id=?i limit 1', array($ko)));
foreach ($url_list as $v) {
if ($v['url']) {
/**
* 獲取單個產品內容
*/
phpQuery::newDocumentFile($v['url']);
$goods_id = intval(pq('input[name="id"]')->attr('value'));
// 說明源id大於47900是無水印的 http://www.tomdurrie.com/search.php?page=380 前判讀吧..
// 63767 後麵開始進行第二次采集
if ($goods_id > 63767) {
// 刪除舊產品數據和相冊數據
示例2: dirname
<?php
// 默認超時
set_time_limit(0);
// 定義應用目錄
define('APP', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
// 載入框架引導文件
require APP . 'system/_shell.php';
require APP . 'funcs/spider.fn.php';
require APP . 'models/ContentModel.php';
system('echo -e "\\033[32m開始獲取隊列... \\033[0m"');
$contentModel = new ContentModel();
$configs = array('need_push' => 'yes');
$url_list = $contentModel->getUrlList($configs, 'LIMIT 50 ');
$url_count = count($url_list);
system('echo -e "\\033[32m 獲取到' . $url_count . '條要采集的內容... \\033[0m"');
if (!empty($url_list)) {
foreach ($url_list as $v) {
$tmp_url_data[$v['task_list_id']][] = $v;
}
foreach ($tmp_url_data as $ko => $vo) {
$url_info = get_line(prepare('select * from task_list where id=?i limit 1', array($ko)));
$content_rules = $url_info['content_rules'];
$content_rules = json_decode($content_rules, true);
$chatset = $content_rules['charset'];
if (!empty($content_rules['type'])) {
foreach ($vo as $va) {
system("echo -e '獲取內容鏈接: \\033[32m" . $va['url'] . "\\033[0m'");
$html = '';
$html = http_client_request($va['url']);
if ($chatset != 'utf-8') {