介绍

可通过此接口批量删除自己的QQ空间留言,相关getGTK,token等算法请参考下方本站博文

PHP实例代码

<?php
$cookie='uin=o'.trim($qq).'; skey='.$skey.'; p_skey='.$pskey.'; p_uin=o'.trim($qq).';';
$url = 'https://user.qzone.qq.com/proxy/domain/m.qzone.qq.com/cgi-bin/new/get_msgb?uin='.$qq.'&hostUin='.$qq.'&num=10&start=0&hostword=0&essence=1&r=0.3395131546088641&iNotice=0&inCharset=utf-8&outCharset=utf-8&format=jsonp&ref=qzone&g_tk='.getGTK($skey).'&qzonetoken='.getToken($skey).'&g_tk='.getGTK($skey);
$return=get_curl($url,0,$url,$cookie);
preg_match_all('/total\":(.*?),/sS',$return,$total);
preg_match_all('/\"id\":\"(.*?)\"/sS',$return,$id);
preg_match_all('/uin\":(.*?),/sS',$return,$uin);
preg_match_all('/htmlContent\":\"(.*?)\"/sS',$return,$htmlContent);
preg_match_all('/pubtime\":\"(.*?)\"/sS',$return,$pubtime);
for ($i=0;$i<count($id[1]);$i++) {
    $post = 'hostUin='.$qq.'&idList='.$id[1][$i].'&uinList='.$uin[1][$i].'&format=fs&iNotice=1&inCharset=utf-8&outCharset=utf-8&ref=qzone&json=1&g_tk='.getGTK($skey).'&qzreferrer=https://user.qzone.qq.com/proxy/domain/qzs.qq.com/qzone/msgboard/msgbcanvas.html#page=1';
    $return=get_curl('https://h5.qzone.qq.com/proxy/domain/m.qzone.qq.com/cgi-bin/new/del_msgb?qzonetoken='.getToken($skey).'&g_tk='.getGTK($skey),$post,0,$cookie);
    //$content[] = $htmlContent[1][$i].'-----'.$pubtime[1][$i];
}
echo '{"code":1,"msg":"删除成功","total":"'.$total[1][0].'"}';
?>

最后修改:2021 年 09 月 17 日
如果觉得我的文章对你有用,请随意赞赏