修改qq呢称api源码

提交QQ及skey即可修改qq号昵称。

获取qqskey源码请移步:php扫码登录qq获取skey、pskey、gtk等信息源码

下面放上源码:

<?php
$qq=$_GET['qq'];
$skey=$_GET['skey'];
$msg=$_GET['msg'];
$get=getGTK($skey);
$url="https://ti.qq.com/proxy/domain/oidb.tim.qq.com/v3/oidbinterface/oidb_0x587_52?sdkappid=20344&actype=2&t=0.4372372994667344&g_tk=".$get;
$post='{"str_nick": "'.$msg.'"}';
$cookie='uin=o'.$qq.'; skey='.$skey;
$data=get_result($url,$post,$cookie);
$arr=json_decode($data,true);
if($arr['code']==0)
{
echo "修改昵称成功,当前昵称:".$msg;
}
else
{
echo "修改昵称失败,请重试!";
}


function get_result($url,$post,$cookie)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$header = array();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); //设置等待时间
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //设置cURL允许执行的最长秒数
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}

function getGTK($skey){
$len = strlen($skey);
$hash = 5381;
for ($i = 0; $i < $len; $i++) {
$hash += ($hash << 5 & 2147483647) + ord($skey[$i]) & 2147483647;
$hash &= 2147483647;
}
return $hash & 2147483647;
}
?>

使用方法:

/xx.php?qq=9147218&skey=@AbvJ8LILI&msg=七寸往事

参数为qq,skey,都可以在php扫码登录qq获取skey、pskey、gtk等信息源码获取到,msg为要修改的呢称

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏
分享
评论 抢沙发

请登录后发表评论