QQ自动点赞PHP源码_QQ名片赞点赞接口 PHP代码

这是一个使用PHP编写的QQ名片赞点赞接口代码,通过GTK和CURL进行请求,适用于自动点赞功能。代码中包含了错误处理和登录状态验证。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

QQ名片赞点赞接口,PHP代码,可自行开发!

(转自AE)<?php

error_reporting(0);

header('content-type:application/json');

date_default_timezone_set("PRC");

$data=$_POST;

$qq=$data['qq'];

$uin=$data['uin'];

$skey=$data['skey'];

$pskey=$data['pskey'];

$count=isset($data['count'])?$data['count']:0;

$gtk=gtk($pskey);

if(!$qq || !$uin || !$skey || !$pskey)exit('error');

$cookie = 'pt2gguin=o0' . $uin . '; uin=o0' . $uin . '; skey=' . $skey . '; p_uin=o0' . $uin.'; p_skey='.$pskey.';';

for($i=0; $i<=$count; $i++){

$url='https://club.vip.qq.com/visitor/like?g_tk='.$gtk.'&nav=0&uin='.$qq.'&t='.times();

$json=get_curl($url,0,'https://club.vip.qq.com/visitor/index?_wv=4099&_nav_bgclr=ffffff&_nav_titleclr=ffffff&_nav_txtclr=ffffff&_nav_alpha=0',$cookie);

}

$arr=json_decode($json,true);

if($arr['retcode']==20003){

$json ='点赞上限';

}elseif($arr['retcode']==10003){

$json ='权限异常';

}elseif($arr['code']=="-400"){

$json ='登录失效';

}elseif($arr['retcode']==0){

$json ='点赞成功';

}else{

$json ='点赞失败';

}

//$fp = fopen("./cookie.log","a+");

//fwrite($fp,$cookie."\r");

//fclose($fp);

exit($json);

function times() {

list($t1, $t2) = explode(' ', microtime());

return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000);

}

function GTK($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;

}

function get_curl($url,$post=0,$referer=0,$cookie=0,$header=0,$ua=0,$nobaody=0,$split=0){

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

$httpheader[] = "Accept:*/*";

$httpheader[] = "Accept-Encoding:gzip,deflate,sdch";

$httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";

$httpheader[] = "Connection:close";

curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);

if($post){

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

}

if($header){

curl_setopt($ch, CURLOPT_HEADER, TRUE);

}

if($cookie){

curl_setopt($ch, CURLOPT_COOKIE, $cookie);

}

if($referer){

curl_setopt($ch, CURLOPT_REFERER, $referer);

}

if($ua){

curl_setopt($ch, CURLOPT_USERAGENT,$ua);

}else{

curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36');

}

if($nobaody){

curl_setopt($ch, CURLOPT_NOBODY,1);

}

curl_setopt($ch, CURLOPT_ENCODING, "gzip");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);

$ret = curl_exec($ch);

if ($split) {

$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);

$header = substr($ret, 0, $headerSize);

$body = substr($ret, $headerSize);

$ret=array();

$ret['header']=$header;

$ret['body']=$body;

}

curl_close($ch);

return $ret;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值