QQ名片赞点赞接口PHP

  • 内容
  • 相关
{L}PLD3_(S``V$F5(OVM6(1.png
<?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;
	}

本文标签:这篇文章木有标签

版权声明:若无特殊注明,本文皆为《灵域云端》原创,转载请保留文章出处。

本文链接:QQ名片赞点赞接口PHP - http://blog.lyuweb.com/?post=129

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论

1条评论
  1. avatar

    几欲成欢 Lv.1 回复

    不会用.....

    看我干什么^_^ 回复一下鸭!

    00:00 / 00:00
    随机播放
    欢迎来到灵域云端博客!
    灵域