php教程

PHP一键刷QQ微信支付宝步数代码

精准像素 2020-09-14 人阅读

PHP一键刷QQ微信支付宝步数代码,账号密码步数填好直接地址栏回车,想要自动刷就设定计划任务。每天自动刷,步数不要太多,容易封运动,导致步数别人看不到!

使用说明:http://域名/?mobile=乐心手机账号&psw=乐心密码&step=步数数量

PHP一键刷QQ微信支付宝步数代码

刷QQ微信支付宝步数代码

<title>QQ微信支付宝刷步数</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no, viewport-fit=cover">
<?php
error_reporting(0);
date_default_timezone_set("Etc/GMT-8");
//获取加秒数的时间戳
function getMillisecond() {
list($t1, $t2) = explode(' ', microtime());
return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000);
}
//post函数
function curl($url, $data='', $method='POST',$header){   
$curl = curl_init(); // 启动一个CURL会话  
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址  
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 对认证证书来源的检查  
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在  
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器  
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转  
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer  
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
if($method=='POST'){  
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求  
if ($data != ''){  
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包  
}  
}  
curl_setopt($curl, CURLOPT_ENCODING ,'gzip');
curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循环  
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容  
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回  
$tmpInfo = curl_exec($curl); // 执行操作  
curl_close($curl); // 关闭CURL会话  
return $tmpInfo; // 返回数据  
}  
//登录的post,取cookie,Content-Type必须加上
$header = [
'Content-Type: application/json; charset=utf-8',
];
$url="sports.lifesense.com/sessions_service/login?systemType=2&version=4.6.7";
$data = '{"appType":6,"clientId":"88888","loginName":"'.$_GET['mobile'].'","password":"'.md5($_GET['psw']).'","roleType":0}';
$html = curl($url,$data,$method='POST',$header);
$html=json_decode($html,true);
//这两个参数下面的post需要
$accessToken= $html['data']['accessToken'];
$userId=$html['data']['userId'];
$step = $_GET['step'];
//取到参数添加到刷步数的post里
$url="sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?version=4.5&systemType=2";
$header = [
'Cookie: accessToken='.$accessToken,
'Content-Type: application/json; charset=utf-8',
];
//步数距离时间戳都要加上才能成功
$data = '{"list":[{"DataSource":2,"active":1,"calories":"'.intval($step/4).'","dataSource":2,"deviceId":"M_NULL","distance":'.intval($step/3).',"exerciseTime":0,"isUpload":0,"measurementTime":"'.date("Y-m-d H:i:s",time()).'","priority":0,"step":'.$step.',"type":2,"updated":'.getMillisecond().',"userId":'.$userId.'}]}';
$html = curl($url,$data,$method='POST',$header);
$html=json_decode($html,true);
$steps = $html['data']['pedometerRecordHourlyList'][0]['step'];
if(!empty($steps)){
echo '当前步数:'.$steps;
}else if(empty($json[resultObj])){
echo "刷步数失败了,请检查账号密码和步数";
}
?>

新建一个PHP文件,复制粘贴上面的代码,命名为index.php