本文整理汇总了PHP中Crawler::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Crawler::update方法的具体用法?PHP Crawler::update怎么用?PHP Crawler::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler
的用法示例。
在下文中一共展示了Crawler::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Crawler
error_reporting(1);
ini_set('display_errors', 1);
set_time_limit(0);
require "simplehtmldom/simple_html_dom.php";
$p = $_GET['p'];
require_once "../backend/models/Crawler.php";
$model = new Crawler();
$sql = "SELECT * FROM post ORDER BY id DESC";
$rs = mysql_query($sql);
while ($row = mysql_fetch_assoc($rs)) {
$url = $row['url'];
$url = str_replace("http://biquyetlamdep.com/", "", $url);
$url = str_replace(".html", "", $url);
$arrData['url'] = $url;
$arrData['id'] = $row['id'];
$model->update("post", $arrData);
}
exit;
$url = "http://biquyetlamdep.com/lam-dep-cung-sao/page/" . $p;
$domain = "";
$cate_id = 6;
$folder_name = "lam-dep-cung-sao";
$arrClass = array('title' => 'h1.entry-title', 'description' => '', 'content' => 'div.td-post-content');
$arrImgExpert = array('share-fb.gif', 'share-gg.gif');
$arrPregReplace = array('#<div class="baiviet-bailienquan">(.*?)</div>#', '#<div id="box_mxh_trang_bai_viet"(.*?)</div>#', '#<script>(.*?)</script>#', '#<script(.*?)</script>#', '#<span id="shareImage(.*?)</span>#', '#<a (.*?)>#', '#</a>#');
$arrStrReplace = array('<!-- A generated by theme -->');
$arrElement = array('.td-ss-main-content .td-module-thumb');
$arrLink = array();
$arrLink = $model->getAllLink($url, $arrElement, $domain, $cate_id, $folder_name);
$classMore = '';
if (!empty($arrLink)) {