『回复列表(9|隐藏机器人聊天)』
<?php
class zan{
var $qq;
var $sid;
var $msg;
var $data;
var $n;//每次最大条数
public function __construct($qq,$sid,$n){
$this->qq =$qq;
$this->sid =$sid;
$this->n =$n;
$this->getnew($sid);
}
function getnew($sid){
$url="http://m.qzone.com/get_feeds?g_tk=".time()."&res_type=0&refresh_type=2&format=json&sid=".$sid;
$json=$this->call($url);
$arr=json_decode($json,true);
$this->msg=array();
if(@array_key_exists('code',$arr) && $arr['code']==0){
$this->msg[]='success';
$shuos=$arr['data']['vFeeds'];
$i=0;
$n=$this->n;
foreach($shuos as $shuo){
$like=$shuo['like']['isliked'];
if($like==0){
$type=$shuo['comm']['appid'];
$curkey=urlencode($shuo['comm']['curlikekey']);
$uinkey=urlencode($shuo['comm']['orglikekey']);
$uin=$shuo['userinfo']['user']['uin'];
$t=$shuo['comm']['time'];
$zq=$this->qq;
if($i<5){
$array=array("106543",$zq);
$array=array_merge($array,$n);
if(!array_search($uin,$array)){
$this->sendlike($uin,$type,$uinkey,$curkey);
$i++;
}elseif($uin==$ly){$t=time()-$t;if($t>3600000){$this->sendlike($uin,$type,$uinkey,$curkey);}}
}
}
}
}
}
function sendlike($uin,$type,$uinkey,$curkey){
$post="opr_type=like&action=0&res_uin=$uin&res_type=$type&uin_key=$uinkey&cur_key=$curkey&format=json&sid=".$this->sid;
$url="http://m.qzone.com/praise/like?g_tk=1223463111";
$json=$this->call_post($url,$post);
$arr=json_decode($json,true);
if(@array_key_exists('code',$arr) && $arr['code']==0){
$this->msg[]='赞'.$uin.'成功!';
}else{
$this->error[]='赞'.$uin.'失败!原因:'.$arr['message'];}
}
function call_post($curl,$curlPost){
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$curl);
curl_setopt($ch,CURLOPT_HEADER,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$curlPost);
$data=curl_exec($ch);
curl_close($ch);
return $data;
}
function call($url) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_USERAGENT,'TTMobile/09.03.18/symbianOS9.1 Series60/3.0 Nokia6120cAP3.03');
curl_setopt($ch,CURLOPT_TIMEOUT,20);
$data = curl_exec($ch);
curl_close($ch);
if ($data){
return $data;}else{
return false;}
}
function getmsg(){
return $this->msg;
}
}
function curl($url) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Linux; U; Android 4.0.3; zh-CN; ZTE U930 Build/IML74K) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.4.2.365 U3/0.8.0 Mobile Safari/533.1');
curl_setopt($ch,CURLOPT_TIMEOUT,20);
$data = curl_exec($ch);
curl_close($ch);
if ($data){
return $data;}else{
return false;}
}
$n=;//要屏蔽的QQ,不赞的号码,这个是数组
$zan= new zan(你的QQ,$sid,$n);
print_r($zan->getmsg());