本文整理汇总了PHP中Crawler::insertPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Crawler::insertPost方法的具体用法?PHP Crawler::insertPost怎么用?PHP Crawler::insertPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler
的用法示例。
在下文中一共展示了Crawler::insertPost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Crawler
<?php
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();
$url = "http://biquyetlamdep.com/trang-diem-dep/page/" . $p;
$domain = "";
$cate_id = 5;
$folder_name = "trang-diem-dep";
$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)) {
$model->insertPost($arrLink, $arrUrl, $arrClass, $arrImgExpert, $folder_name, $arrPregReplace, $arrStrReplace, '', $classMore, $cate_id);
} else {
echo "<h1>Not found articles.</h1>";
}