Example #1
0
function evo_rules_get_article($str, $rules_info)
{
    $rules_info['theme_get_type'] = $rules_info['theme_get_type'] ? $rules_info['theme_get_type'] : 1;
    $get = 0;
    if ($rules_info['theme_get_type'] == 1 && $rules_info['content_get_type'] == 1) {
        $re = dom_single_article($str, array('title' => $rules_info['theme_rules'], 'content' => $rules_info['content_rules']));
        $data['title'] = $re['title'];
        $data['content'] = $re['content'];
        $get = 1;
    }
    if ($get != 1) {
        if ($rules_info['theme_get_type'] == 1) {
            $re = dom_single_article($str, array('content' => $rules_info['content_rules']));
            $data['title'] = $re['title'];
        } else {
            if ($rules_info['theme_get_type'] == 2) {
                $re = pregmessage($str, $rules_info['theme_rules'], 'title', -1);
                $data['title'] = $re[0];
            }
        }
        if ($rules_info['content_get_type'] == 1) {
            $re = dom_single_article($str, array('content' => $rules_info['content_rules']));
            $data['content'] = $re['content'];
        } else {
            if ($rules_info['content_get_type'] == 2) {
                $data['content'] = str_get_str($str, $rules_info['content_rules'], 'body', -1);
            }
        }
    }
    //过滤
    if ($rules_info['is_fiter_title'] == 1 && $data['title']) {
        $format_args = array('is_fiter' => $rules_info['is_fiter_title'], 'show_type' => 'title', 'result_data' => $data['title'], 'replace_rules' => $rules_info['title_replace_rules'], 'filter_data' => dunserialize($rules_info['title_filter_rules']), 'test' => 2, 'filter_html' => '');
        $data['title'] = filter_article($format_args);
    }
    if ($rules_info['is_fiter_content'] == 1 && $data['content']) {
        $format_args = array('is_fiter' => $rules_info['is_fiter_content'], 'show_type' => 'body', 'result_data' => $data['content'], 'replace_rules' => $rules_info['content_replace_rules'], 'filter_data' => dunserialize($rules_info['content_filter_rules']), 'test' => 2, 'filter_html' => dunserialize($rules_info['content_filter_html']));
        $data['content'] = filter_article($format_args);
    }
    return $data;
}
Example #2
0
function pregmessagearray($messagetext, $rulearr, $mnum, $getpage = 0, $getsubject = 0, $msgurl = '')
{
    global $_SGLOBAL, $alang;
    if ($getsubject) {
        $mnum = $mnum + 1;
    }
    $msgarr = array('subject' => '', 'dateline' => '', 'itemfrom' => '', 'author' => '', 'message' => '', 'importcatid' => $rulearr['importcatid'], 'importtype' => $rulearr['importtype'], 'pagearr' => array(), 'picarr' => array(), 'flasharr' => array(), 'patharr' => array());
    $nextprogress = true;
    #Modify  by jiangyanfeng
    $msgarr['newsfromurl'] = $msgurl;
    #End
    //文章标题识别
    if ($getsubject && $messagetext && !empty($rulearr['subjectrule'])) {
        $subjectarr = pregmessage($messagetext, $rulearr['subjectrule'], 'subject');
        $msgarr['subject'] = $subjectarr[0];
    }
    //文章标题过滤
    if ($getsubject && $msgarr['subject'] && !empty($rulearr['subjectfilter'])) {
        $rule = convertrule($rulearr['subjectfilter']);
        $msgarr['subject'] = preg_replace("/({$rule})/s", '', $msgarr['subject']);
    }
    //文章标题文字替换
    if ($getsubject && $msgarr['subject'] && !empty($rulearr['subjectreplace'])) {
        $rulearr['subjectreplace'] = explode("\n", $rulearr['subjectreplace']);
        $rulearr['subjectreplaceto'] = explode("\n", $rulearr['subjectreplaceto']);
        $msgarr['subject'] = stringreplace($rulearr['subjectreplace'], $rulearr['subjectreplaceto'], $msgarr['subject']);
    }
    //文章标题包含关键字
    if ($getsubject && $msgarr['subject'] && !empty($rulearr['subjectkey'])) {
        $rule = convertrule($rulearr['subjectkey']);
        $newsubject = preg_replace("/({$rule})/s", '', $msgarr['subject']);
        if ($newsubject == $msgarr['subject']) {
            showprogress('[' . $mnum . '] ' . $msgarr['subject'] . ' ' . $alang['robot_robot_subject_no_key']);
            $nextprogress = false;
            $msgarr['subject'] = '';
        }
    }
    //文章标题关键字剔除过滤
    if ($getsubject && $msgarr['subject'] && !empty($rulearr['subjectkeycancel'])) {
        $rule = convertrule($rulearr['subjectkeycancel']);
        $newsubject = preg_replace("/({$rule})/s", '', $msgarr['subject']);
        if ($newsubject != $msgarr['subject']) {
            showprogress('[' . $mnum . '] ' . $msgarr['subject'] . ' ' . $alang['robot_robot_subject_key_cancel']);
            $nextprogress = false;
            $msgarr['subject'] = '';
        }
    }
    $msgarr['subject'] = trim($msgarr['subject']);
    if ($getsubject && $nextprogress && empty($msgarr['subject'])) {
        showprogress('[' . $mnum . '] ' . $alang['robot_robot_subject_null']);
        $nextprogress = false;
    }
    if ($getsubject && $nextprogress && !$rulearr['subjectallowrepeat']) {
        $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('robotlog') . ' WHERE hash=\'' . md5($msgarr['subject']) . '\'');
        if ($_SGLOBAL['db']->result($query, 0)) {
            showprogress('[' . $mnum . '] ' . $msgarr['subject'] . ' ' . $alang['robot_robot_subject_exists']);
            $nextprogress = false;
        }
    }
    if ($nextprogress && $getsubject && $msgarr['subject']) {
        showprogress('[' . $mnum . '] [<b>' . $msgarr['subject'] . '</b>] ' . $alang['robot_robot_deal'] . '<b>' . '<b>' . $alang['robot_robot_subject'] . '</b>' . $alang['robot_robot_success']);
    }
    if (!$nextprogress) {
        $msgarr['subject'] = '';
    }
    //DATELINE
    if (empty($rulearr['defaultdateline'])) {
        $msgarr['dateline'] = $_SGLOBAL['timestamp'];
    } else {
        $msgarr['dateline'] = intval($rulearr['defaultdateline']);
    }
    //信息来源识别
    if ($getsubject && $nextprogress && !empty($rulearr['fromrule'])) {
        if (preg_match("/\\[from\\]/", $rulearr['fromrule'])) {
            $fromarr = pregmessage($messagetext, $rulearr['fromrule'], 'from');
        } else {
            $fromarr[0] = $rulearr['fromrule'];
        }
        $msgarr['itemfrom'] = $fromarr[0];
        if ($msgarr['itemfrom']) {
            showprogress('[' . $mnum . '] [<b>' . $msgarr['itemfrom'] . '</b>] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_itemfrom'] . '</b>' . $alang['robot_robot_success']);
        } else {
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . '<b>' . $alang['robot_robot_itemfrom'] . '</b>' . $alang['robot_robot_failed']);
        }
    }
    //作者识别
    if ($getsubject && $nextprogress && !empty($rulearr['authorrule'])) {
        if (preg_match("/\\[author\\]/", $rulearr['authorrule'])) {
            $authorarr = pregmessage($messagetext, $rulearr['authorrule'], 'author');
        } else {
            $rulearr['authorrule'] = explode('|', $rulearr['authorrule']);
            $rulearr['authorrule'] = strim($rulearr['authorrule']);
            if (is_array($rulearr['authorrule'])) {
                foreach ($rulearr['authorrule'] as $tmpkey => $tmpvalue) {
                    if (empty($tmpvalue)) {
                        unset($rulearr['authorrule'][$tmpkey]);
                    }
                }
                $tmprand = 0;
                $tmprand = rand(0, count($rulearr['authorrule']) - 1);
                $authorarr[0] = $rulearr['authorrule'][$tmprand];
            } else {
                $authorarr[0] = $rulearr['authorrule'];
            }
        }
        $msgarr['author'] = $authorarr[0];
        if ($msgarr['author']) {
            showprogress('[' . $mnum . '] [<b>' . $msgarr['author'] . '</b>] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_author'] . '</b>' . $alang['robot_robot_success']);
        } else {
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_author'] . '</b>' . $alang['robot_robot_failed']);
        }
    }
    //发布者UID
    if ($getsubject && $nextprogress && !empty($rulearr['uidrule'])) {
        $rulearr['uidrule'] = explode('|', $rulearr['uidrule']);
        $rulearr['uidrule'] = strim($rulearr['uidrule']);
        if (is_array($rulearr['uidrule'])) {
            foreach ($rulearr['uidrule'] as $tmpkey => $tmpvalue) {
                if (empty($tmpvalue)) {
                    unset($rulearr['uidrule'][$tmpkey]);
                }
            }
            $tmprand = 0;
            $tmprand = rand(0, count($rulearr['uidrule']) - 1);
            $msgarr['uid'] = intval($rulearr['uidrule'][$tmprand]);
        } else {
            $msgarr['uid'] = intval($rulearr['uidrule']);
        }
    }
    //文章内容识别
    if ($nextprogress && !empty($rulearr['messagerule'])) {
        if (empty($rulearr['messagerule'])) {
            $rsmessagearr = getrobotmessage($messagetext, $msgurl, 2);
            $messagearr[0] = $rsmessagearr['leachmessage'];
        } else {
            $messagearr = pregmessage($messagetext, $rulearr['messagerule'], 'message');
        }
        $msgarr['message'] = $messagearr[0];
    }
    //文章内容过滤
    if ($nextprogress && $msgarr['message'] && !empty($rulearr['messagefilter'])) {
        $rule = convertrule($rulearr['messagefilter']);
        $msgarr['message'] = preg_replace("/({$rule})/s", '', $msgarr['message']);
    }
    //文章内容文字替换
    if ($nextprogress && $msgarr['message'] && !empty($rulearr['messagereplace'])) {
        $rulearr['messagereplace'] = explode("\n", $rulearr['messagereplace']);
        $rulearr['messagereplaceto'] = explode("\n", $rulearr['messagereplaceto']);
        $msgarr['message'] = stringreplace($rulearr['messagereplace'], $rulearr['messagereplaceto'], $msgarr['message']);
    }
    //文章内容包含关键字
    if ($nextprogress && $msgarr['message'] && !empty($rulearr['messagekey'])) {
        $rule = convertrule($rulearr['messagekey']);
        $newmessage = preg_replace("/({$rule})/s", '', $msgarr['message']);
        if ($newmessage == $msgarr['message']) {
            showprogress('[' . $mnum . '] ' . $msgarr['subject'] . ' ' . $alang['robot_robot_message_no_key']);
            $nextprogress = false;
            $msgarr['message'] = '';
        }
    }
    //文章内容关键字剔除过滤
    if ($nextprogress && $msgarr['message'] && !empty($rulearr['messagekeycancel'])) {
        $rule = convertrule($rulearr['messagekeycancel']);
        $newmessage = preg_replace("/({$rule})/s", '', $msgarr['message']);
        if (md5($newmessage) != md5($msgarr['message'])) {
            showprogress('[' . $mnum . '] ' . $msgarr['subject'] . ' ' . $alang['robot_robot_message_key_cancel']);
            $nextprogress = false;
            $msgarr['message'] = '';
        }
    }
    //文章内容格式化
    if ($nextprogress && $msgarr['message'] && !empty($rulearr['messageformat'])) {
        $rsmessagearr = getrobotmessage($msgarr['message'], $msgurl);
        $msgarr['message'] = $rsmessagearr['leachmessage'];
    }
    if ($nextprogress) {
        if ($msgarr['message']) {
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_message'] . '</b>' . $alang['robot_robot_success']);
        } else {
            $msgarr['subject'] = '';
            $nextprogress = false;
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_message'] . '</b>' . $alang['robot_robot_failed']);
        }
    }
    //LOCAL PIC URL
    if ($nextprogress && (!empty($rulearr['picurllinkpre']) || $rulearr['savepic'])) {
        preg_match_all("/\\<img\\s+.*?src=[\\'\"]*([a-z0-9\\/\\-_+=.~!%@?#%&;:\$\\()|]+)[\\'\"\\s\\>]+/is", $msgarr['message'], $picurlarr);
        if (!empty($picurlarr[1])) {
            $msgarr['picarr'] = sarray_unique($picurlarr[1]);
        }
        if (!empty($rulearr['picurllinkpre'])) {
            foreach ($msgarr['picarr'] as $pickey => $picurl) {
                if (strpos($picurl, '://') === false) {
                    $msgarr['picarr'][$pickey] = $rulearr['picurllinkpre'] . $picurl;
                    $msgarr['message'] = str_replace($picurl, $rulearr['picurllinkpre'] . $picurl, $msgarr['message']);
                }
            }
        } else {
            $url = array();
            $posturl = parse_url($msgurl);
            foreach ($msgarr['picarr'] as $pickey => $picurl) {
                if (!empty($picurl)) {
                    $url = parse_url($picurl);
                    if (!empty($url['host'])) {
                        $msgarr['picarr'][$pickey] = $picurl;
                    } else {
                        $offset = strpos($picurl, '/');
                        if (!is_bool($offset) && $offset == 0) {
                            $msgarr['picarr'][$pickey] = $posturl['scheme'] . '://' . $posturl['host'] . $picurl;
                        } else {
                            $msgarr['picarr'][$pickey] = substr($msgurl, 0, strrpos($msgurl, '/')) . '/' . $picurl;
                        }
                    }
                    $msgarr['message'] = str_replace($picurl, $msgarr['picarr'][$pickey], $msgarr['message']);
                }
            }
        }
        if ($rulearr['savepic']) {
            $msgarr = saveurlarr($msgarr, 'picarr');
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_picarr'] . '</b>' . $alang['robot_robot_success']);
        }
    }
    //LOCAL FLASH URL
    if ($nextprogress && (!empty($rulearr['picurllinkpre']) || $rulearr['saveflash'])) {
        preg_match_all("/\\<embed\\s+.*?src=[\\'\"]*([a-z0-9\\/\\-_+=.~!%@?#%&;:\$\\()|])[\\'\"\\s\\>]+/is", $msgarr['message'], $flashurlarr);
        if (!empty($flashurlarr[1])) {
            $msgarr['flasharr'] = sarray_unique($flashurlarr[1]);
        }
        if (!empty($rulearr['picurllinkpre'])) {
            foreach ($msgarr['flasharr'] as $flashkey => $flashurl) {
                if (strpos($flashurl, '://') === false) {
                    $msgarr['flasharr'][$flashkey] = $rulearr['picurllinkpre'] . $flashurl;
                    $msgarr['message'] = str_replace($flashurl, $rulearr['picurllinkpre'] . $flashurl, $msgarr['message']);
                }
            }
        } else {
            $url = array();
            $posturl = parse_url($msgurl);
            foreach ($msgarr['flasharr'] as $flashkey => $flashurl) {
                if (!empty($flashurl)) {
                    $url = parse_url($flashurl);
                    if (!empty($url['host'])) {
                        $msgarr['flasharr'][$flashkey] = $flashurl;
                    } else {
                        $offset = strpos($flashurl, '/');
                        if (!is_bool($offset) && $offset == 0) {
                            $msgarr['flasharr'][$flashkey] = $posturl['scheme'] . '://' . $posturl['host'] . $flashurl;
                        } else {
                            $msgarr['flasharr'][$flashkey] = substr($msgurl, 0, strrpos($msgurl, '/')) . '/' . $flashurl;
                        }
                    }
                    $msgarr['message'] = str_replace($flashurl, $msgarr['flasharr'][$flashkey], $msgarr['message']);
                }
            }
        }
        if ($rulearr['saveflash']) {
            $msgarr = saveurlarr($msgarr, 'flasharr');
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_flasharr'] . '</b>' . $alang['robot_robot_success']);
        }
    }
    //PAGE URL
    if ($getpage && $nextprogress && !empty($rulearr['messagepagerule'])) {
        $messagepagearr = pregmessage($messagetext, $rulearr['messagepagerule'], 'pagearea');
        $messagepage = $messagepagearr[0];
        if ($messagepage && !empty($rulearr['messagepageurlrule'])) {
            $msgarr['pagearr'] = pregmessage($messagepage, $rulearr['messagepageurlrule'], 'page', -1);
            $msgarr['pagearr'] = sarray_unique($msgarr['pagearr']);
        }
        if ($msgarr['pagearr']) {
            if (!empty($rulearr['messagepageurllinkpre'])) {
                foreach ($msgarr['pagearr'] as $pkey => $purl) {
                    if (strpos($purl, '://') === false) {
                        $msgarr['pagearr'][$pkey] = $rulearr['messagepageurllinkpre'] . $purl;
                    }
                }
            } else {
                $url = array();
                $posturl = parse_url($msgurl);
                foreach ($msgarr['pagearr'] as $pkey => $purl) {
                    if (!empty($purl)) {
                        $url = parse_url($purl);
                        if (!empty($url['host'])) {
                            $msgarr['pagearr'][$pkey] = $purl;
                        } else {
                            $offset = strpos($purl, '/');
                            if (!is_bool($offset) && $offset == 0) {
                                $msgarr['pagearr'][$pkey] = $posturl['scheme'] . '://' . $posturl['host'] . $purl;
                            } else {
                                $msgarr['pagearr'][$pkey] = substr($msgurl, 0, strrpos($msgurl, '/')) . '/' . $purl;
                            }
                        }
                    }
                }
            }
            if (!empty($rulearr['messagepageurllinkpf'])) {
                foreach ($msgarr['pagearr'] as $pkey => $purl) {
                    if (!empty($purl)) {
                        $msgarr['pagearr'][$pkey] = $purl . $rulearr['messagepageurllinkpf'];
                    }
                }
            }
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_pagearr'] . '</b>' . $alang['robot_robot_success']);
        } else {
            showprogress('[' . $mnum . '] ' . $alang['robot_robot_deal'] . '<b>' . $alang['robot_robot_pagearr'] . '</b>' . $alang['robot_robot_failed']);
        }
    }
    return $msgarr;
}
Example #3
0
/**
 * 常用api大全
 *
 * @author 步飞凌云
 * @url http://www.012wz.com
 */
if ($type == "xingming" or $type == "nametest") {
    $type = "namequery";
    typeupdate($type, $weid, $openid);
    $reply = '您输入您要查询的姓名,如:张三';
} else {
    $url = 'http://m.1518.com/xingming_view.php?word=' . urlencode(iconv("UTF-8", "GB2312//IGNORE", $msg)) . '&submit1=%C8%B7%B6%A8&FrontType=1';
    $message = file_get_contents($url);
    $message = iconv("GB2312", "UTF-8", $message);
    $getout = pregmessage($message, "<dl>[title]</dl>", 'title', 2);
    $getout1 = strip_tags($getout[0]);
    preg_match('/<dt[^>]*>([\\s\\S]*?)<\\/dt>/', $getout[0], $mark);
    preg_match_all('/<dd[^>]*>([\\s\\S]*?)<\\/dd>/', $getout[0], $marks);
    preg_match_all('/<dd[^>]*>([\\s\\S]*?)<\\/dd>/', $getout[1], $gaishu);
    preg_match_all('/<dd[^>]*>([\\s\\S]*?)<\\/dd>/', $getout[2], $zonglun);
    $marks = strip_tags($marks[1][1]);
    $marks = str_replace("    ", "", $marks);
    $gaishu = str_replace("<br>", "\n", $gaishu[1][0]);
    $zonglun = str_replace("<br>", "\n", $zonglun[1][0]);
    $title = "姓名测试:" . $msg;
    $news = array();
    $news[] = array('title' => $title, 'description' => '', 'picurl' => $imgurl . '/name.jpg', 'url' => $url);
    $news[] = array('title' => strip_tags($mark[1]) . "\n\n" . $marks . $gaishu . $zonglun, 'description' => '', 'url' => $url);
    $news[] = array('title' => '本测试结果仅供娱乐,非科学测算', 'description' => '', 'url' => $url);
    $news[] = array('title' => '回复【退出】,退出本次会话', 'description' => '', 'url' => $url);
Example #4
0
 function get_rules($info, $evo_info, $data_info, $type)
 {
     if ($data_info['evo_' . $type . '_info'] != serialize($evo_info)) {
         return FALSE;
     }
     //资料不一样
     $get_type = 1;
     $pre_arr = $re = array();
     $filter_html = array(0);
     //去掉a标签
     //
     if ($evo_info['attr']['id'] && !preg_match('/\\d+/', $evo_info['attr']['id'])) {
         //优先用id
         $rules = $re['rules'] = $pre_arr['id'] = $evo_info['tag_name'] . '[id=' . $evo_info['attr']['id'] . ']';
         $div = $this->dom_obj->find($rules);
         $re['get_type'] = 1;
         $get_result = trim($div[0]->innertext);
         if ($type == 'title') {
             if (strpos($get_result, '</a>') != FALSE) {
                 $re['rules'] .= ' a';
                 $get_result = clear_html_script($get_result, $filter_html);
             }
         }
         if ($get_result == $info[$type]['html']) {
             return $re;
         }
     }
     if ($evo_info['attr']['class']) {
         //其次是class
         $rules = $re['rules'] = $pre_arr['class'] = $evo_info['tag_name'] . '[class=' . $evo_info['attr']['class'] . ']';
         $div = $this->dom_obj->find($rules);
         $re['get_type'] = 1;
         $get_result = trim($div[0]->innertext);
         if ($type == 'title') {
             if (strpos($get_result, '</a>') != FALSE) {
                 $re['rules'] .= ' a';
                 $get_result = clear_html_script($get_result, $filter_html);
             }
         }
         if ($get_result == $info[$type]['html']) {
             return $re;
         }
     }
     $pre_rules = $pre_arr['id'] ? $pre_arr['id'] : $pre_arr['class'];
     $pre_rules = $pre_rules ? $pre_rules : $evo_info['tag_name'];
     //然后用父级属性
     if ($evo_info['parent']['attr']['id'] && !preg_match('/\\d+/', $evo_info['parent']['attr']['id']) && $pre_rules) {
         $rules = $re['rules'] = $evo_info['parent']['tag_name'] . '[id=' . $evo_info['parent']['attr']['id'] . ']' . ' ' . $pre_rules;
         $div = $this->dom_obj->find($rules);
         $get_result = trim($div[0]->innertext);
         $re['get_type'] = 1;
         if ($type == 'title') {
             if (strpos($get_result, '</a>') != FALSE) {
                 $re['rules'] .= ' a';
                 $get_result = clear_html_script($get_result, $filter_html);
             }
         }
         if ($get_result == $info[$type]['html']) {
             return $re;
         }
     }
     if ($evo_info['parent']['attr']['class'] && $pre_rules) {
         $rules = $re['rules'] = $evo_info['parent']['tag_name'] . '[class=' . $evo_info['parent']['attr']['class'] . ']' . ' ' . $pre_rules;
         $div = $this->dom_obj->find($rules);
         $re['get_type'] = 1;
         if (trim($div[0]->innertext) == $info[$type]['html']) {
             return $re;
         }
     }
     //用正则匹配。
     $get_type = $re['get_type'] = 2;
     $split_arr = $info[$type . '_split_arr'];
     $flag = $type == 'title' ? 'title' : 'body';
     $rules = $re['rules'] = $split_arr[0] . '[' . $flag . ']' . $split_arr[1];
     $rules = preg_replace(array('/[^h]\\d+/'), array('*'), $rules);
     $result = pregmessage($this->str, $rules, $flag, -1);
     if (trim($result[0]) == $info[$type]['html']) {
         return $re;
     }
     return FALSE;
 }
Example #5
0
 function get_article($content, $url = '')
 {
     global $_G;
     $url = $url ? $url : $this->now_url;
     $pick_config = $_G['cache']['evn_milu_pick']['pick_config'];
     require_once libfile('function/home');
     if ($this->temp_arr['have_page'] != 1) {
         $this->a++;
         $this->pick_cache_data['a'] = $this->a;
     }
     if ($this->p_arr['rules_type'] == 3) {
         //一键采集
         $article_info = get_single_article($content, $url);
     } else {
         //先取标题
         if ($this->p_arr['theme_get_type'] == 3) {
             //智能识别
             $article_info = get_single_article($content, $url);
         } else {
             if ($this->p_arr['theme_get_type'] == 1) {
                 //dom获取
                 $article_info = dom_single_article($content, array('title' => $this->p_arr['theme_rules']));
             } else {
                 if ($this->p_arr['theme_get_type'] == 2) {
                     //字符串
                     $re = pregmessage($content, '<title>[title]</title>', 'title', -1);
                     $article_info['other']['old_title'] = $re[0];
                     $article_info['title'] = str_get_str($content, $this->p_arr['theme_rules'], 'title', -1);
                 }
             }
         }
         //标题要做额外的工作,清理掉多余的html
         $article_info['title'] = format_html($article_info['title']);
         if (!trim($article_info['title'])) {
             return $article_info;
         }
         //如果标题都取不到,不必浪费时间获取内容
         //再取内容
         if ($this->p_arr['content_get_type'] == 3) {
             //智能识别
             if ($this->p_arr['theme_get_type'] != 3) {
                 $info_arr = get_single_article($content, $url);
                 $article_info['content'] = $info_arr['content'];
             }
         } else {
             if ($this->p_arr['content_get_type'] == 1) {
                 //dom获取
                 $info_arr = dom_single_article($content, array('content' => $this->p_arr['content_rules']));
                 $article_info['content'] = $info_arr['content'];
             } else {
                 if ($this->p_arr['content_get_type'] == 2) {
                     //字符串
                     $article_info['content'] = str_get_str($content, $this->p_arr['content_rules'], 'body', -1);
                 }
             }
         }
         if (!$article_info['content'] && $pick_config['ask_mode'] == 1) {
             $article_info['content'] = $article_info['title'];
         }
         //取其他内容
         $other_arr = $this->get_article_other($content);
         $other_arr = $other_arr ? $other_arr : array();
         $article_info = array_merge($article_info, $other_arr);
     }
     //附件
     if ($this->p_arr['is_download_file'] == 1) {
         $article_info['content'] = attach_format($url, $article_info['content']);
     }
     //需要回复才能看到的内容
     if (VIP) {
         $article_info['content'] = post($article_info['content'], array('cookie' => $this->p_arr['login_cookie'], 'page_url' => $url));
     }
     $article_info['content'] = format_html($article_info['content']);
     $article_info['content'] = unhtmlentities($article_info['content']);
     $article_info['url'] = $url;
     $article_info['content'] = clear_ad_html($article_info['content']);
     $article_info['content'] = getstr($article_info['content'], 0, 1, 1, 0, 1);
     return $article_info;
 }