From:
http://www.21andy.com/blog/20060202/153.html20小時(shí)讀一次目標的站,可以自己修改,看下就明白怎么弄其他站了,很簡(jiǎn)單的
chuanqi.php //小偷<?
extract($_GET);extract($_POST);
$clinchurl = "http://www.haosf.com"; //目標站
$url = $clinchurl.$domain;
$fp=@fopen($url,"r") or die("timeout");//判斷網(wǎng)頁(yè)能否打開(kāi)
$fcontents = file_get_contents($url);
//echo $fcontents;
if(eregi(‘傳奇服務(wù)器名</font></b></div></td>(.*)>下一頁(yè)</a></div></td>‘,$fcontents,$regs))
{
//上面的(.*)是你要得到的內容-列表的地方
$clinch = "<table width=\"1004\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">
<tr bgcolor=\"#990000\">
<td width=\"96\"><div align=\"left\"><b><font color=\"#FFFFFF\">傳奇服務(wù)器名</font></b></div></td>".$regs[1]."</a></div></td>";
//把得到的內容的html補齊,自己發(fā)揮
}//END IF
$clinch=str_replace(‘<td width="1002" valign="middle" align="center"><p><a ><img src="img/tmj.gif" width="926" height="80" border="0"></a></p>
<p><a target="_blank"><img src="img/bazhe1.gif" width="926" height="80" border="0"></a></p></td>‘,‘你自己的廣告‘,$clinch);
//一連串的str_replace,替換掉不需要的東西,比如廣告或圖片
?>
<?
include "lanmu.php"; //欄目列表
?>
<iframe width=0 height=0 frameborder=0 scrolling=no src=http://你的站.com/make.php?file=index.html ></iframe>
//利用這個(gè)判斷更新html頁(yè)面
<?=$clinch?>
<?
include "foot.php";
?>
<?
extract($_GET);extract($_POST);
$url="http://xxxxxxx.com/chuanqi.php";
if(!$file){ $file="index.html";$url="http://xxxxxxxxxxxx.com/chuanqi.php"; }
/*自己加判斷這個(gè)$url的語(yǔ)句,來(lái)賦予 $file不同的名字-----------》生成不同的html名字
比如:
if($file="wow.html"){
//$file是在人們訪(fǎng)問(wèn)html頁(yè)面時(shí)由iframe傳遞過(guò)來(lái)的
$url="http://xxxxxx/wow.php" //相應的動(dòng)態(tài)頁(yè)面
}
*/
$path=$file;
$cache_filetime = filemtime($path);
if (time() - $cache_filetime <= 72000) {
//** the cache is not expire
echo "還沒(méi)有必要更新";
}else{
$fp=@fopen($url,"r") or die("timeout");//判斷網(wǎng)頁(yè)能否打開(kāi)
$fcontents = file_get_contents($url);
$handle=fopen($path,‘w‘); //寫(xiě)入方式打開(kāi)路徑
fwrite($handle,$fcontents); //把剛才替換的內容寫(xiě)進(jìn)生成的HTML文件
fclose($handle);
echo "done";
}
?>