PHP knows and asks the collection plug-in code_PHP tutorial
WBOYOriginal
2016-07-21 15:33:50748browse
Recently I have discovered that there are more and more versions of Know and Ask the Thief! ! I saw a Baidu thief’s website and it also reached pr6. More than 100,000 collected! ! After forty days of practice on Jianlila, I found that Baidu is indeed very friendly to this. Judging from website visits, many of them are also searched from Baidu! So it is still feasible to fill the website content with know and ask. So I developed a collection plug-in for knowing questions In principle, it is suitable for php+mysql and the article is in a table program I know the collection code
Copy Code The code is as follows:
session_start(); header("content-type:text/html;charset=gbk"); require("stole_config.php"); require("conn.php"); require("keyword.php"); $searchStr=$_GET["searchStr"]; $ss=explode(" ",$searchStr );//Split search keywords $word="";//Set keywords to empty foreach($ss as $key=>$t) { if( $key>0) { $word .="+"; } $word .=urlencode($t); } $jl=intval($ _GET['jl']); if(isset($_GET['page'])) { $page=intval($_GET['page']); }else { $page=1; } $rs=intval($_GET['rs']); if($rs>=10) { $rs =0; $page++; } if($page>76) { echo "Collection completed ${jl}"; exit(); } if(!empty($searchStr))//If search { //Get the question page $content=@file_get_contents("http://zhidao.baidu.com/q ?ct=17&lm=0&tn=ikaslist&pn=".(($page-1)*10)."&rn=10&word=".$word); //Get the question list preg_match_all("/< a href="/question/(.*).html/iUs",$content,$uid); $uid=$uid[1];//Get detailed page articles $uid=$uid [$rs]; //Determine whether the data exists $suid="bd{$uid}"; $sct=mysql_query("select count(*) from {$table_prefix}c_article where suid ='$suid' "); $sct=mysql_fetch_array($sct); $sct=$sct[0]; if($sct==0) { $content=@file_get_contents("http://zhidao.baidu.com/question/".$uid.".html") ; $arr=explode('',$content); $art_title=$arr[1]; $arr=explode('',$art_title); $art_title=$arr[0];//End of getting title //Determine whether the content conforms to $word_arr=explode(",",$cj_word); $word_allow=false;//Whether initialization allows collection $word_count=count($word_arr);/ /Total number of keywords for($i=0;$i<$word_count;$i++) { if(substr_count($art_title,$word_arr[$i])>0) { $word_allow=1; $i=$word_count; } } if($word_allow)//If the conditions are met { $arr= explode('
http://www.bkjia.com/PHPjc/322561.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322561.htmlTechArticleRecently I have found that there are more and more versions of Know and Ask the Thief! ! I have seen a Baidu thief website that also reached PR6. More than 100,000 collected! ! After forty days of practice with Jianlila...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn