EMS官方改版了,我原来的小偷程序截取不到信息了,哪位好心人能帮忙看看怎么修改吗?谢谢各位大侠哈。<?php
!defined('IN_TW')&& exit('Access Denied');
$request=new HttpClient('www.ems.com.cn');
//    $request->setDebug(true);
$request->setCookies($TW_SESSION);
$request->referer='http://www.ems.com.cn/qcgzOutQueryNewAction.do'; $_POST['mailNum']=$_POST['mailNo'];
$_POST[$_POST['verifyName']]=$_POST['verifyCode'];
!$request->post('/qcgzOutQueryNewAction.do',$_POST)&&exit($request->getError());
$html= $request->getContent();
header('Content-type:text/html;charset=gb2312');
echo trimHtml($html);function trimHtml($html){
$json=array(
'status'=>0,
'message'=>'',
'data'=>array()
);
if(strpos($html,'class="message"')!==false)
{
$start_pos=strpos($html,'class="message">')+16;
$start_pos=strpos($html,'>',$start_pos)+1;
$len=strpos($html,'<br',$start_pos)-$start_pos;
$html=trim(substr($html,$start_pos,$len));
$json['message']=$html;
return gbk_json_encode($json); }
$qianshou='';
if(($pos=strpos($html,'<td class="txt-main" align="left"><strong>'))!==false && ($pos=strpos($html,'<span class="txt-basic-info-e-time">',$pos))!==false){
// $pos=strpos($html,'<span class="txt-basic-info-e-time">',$pos);
$len=strpos($html,'</strong>',$pos)-$pos;
$qianshou=substr($html,$pos,$len);
$time=strip_tags(substr($qianshou,0,strpos($qianshou,'</span>')));
$context=strip_tags(substr($qianshou,strpos($qianshou,'</span>')));
$qianshou=array(
'time'=>trim($time),
'context'=>trim($context)
);
}
$start_pos=strpos($html,'td class="txt-main" align="left">')+33;
$start_pos=strpos($html,'<table',$start_pos);
$start_pos=strpos($html,'</tr>',$start_pos)+5;
$len=strpos($html,'</table>',$start_pos)-$start_pos;
$html=substr($html,$start_pos,$len);
$rows=explode('</tr>',$html);
array_walk($rows,'array_strip_tags','<td>');
$rows=array_filter($rows); $date='';
$json['status']=1;
foreach($rows as $row){
$cell=explode('</td>',$row);
$time=str_replace('&nbsp;','',trim(strip_tags($cell[1])));
$context=trim(strip_tags($cell[2])).trim(strip_tags($cell[3]));
if(!$time && !$context)continue;
if($time[4]=='-' || $time[4]=='/'){
   $date=substr($time,0,10);
$time=$date.' '.substr($time,10);
}else{
$time=$date.' '.$time;
}
$json['data'][]=array(
'time'=>$time,
'context'=>$context
); }
if(is_array($qianshou)){
//        array_pop($json['data']);
$json['data'][]=$qianshou;
}
return gbk_json_encode($json);
}
?>
这个可以截取原来未改版前的信息,改版后截取不到信息了。