标题: 采集笑话源码
时间: 2014-04-07
<?php
#采集笑话函数
function joke(){
for($i=0;$i<3;$i++){
$u="http://m.kxin.cc/view.asp?id=21934";
$f=file_get_contents($u);
preg_match_all("/view\.asp\?id=(\d+)/",$f,$j);
$p=$j[1][4];
$_u="http://m.kxin.cc/view.asp?id=$p";
$_f=file_get_contents($_u);
$c=explode("标题:",$_f);
$c=explode("view",$c[1]);
$nr=str_replace("<br/>","\r\n",$c[0]);
$nr=str_replace("href=","",$nr);
$nr=str_replace("<","",$nr);
$nr=str_replace("a","",$nr);
$wd=$nr."|";
$fpt=fopen("joke.txt","a+");
$ff=file_get_contents("joke.txt");
if(!strstr($ff,$nr)){
fwrite($fpt,$wd,strlen($wd));
}}
}
joke();
『回复列表(1|隐藏机器人聊天)』