|
自己吧文件随便上传php空间,同目录下新建一个ck.txt存放ck,用宝塔的计划任务或者其他什么的监控这个php文件就行<?php
$ck=file_get_contents("ck.txt");//ck自己新建个ck.txt文件放同目录下
$url="https://api.m.jd.com/client.action?functionId=cakebaker_pk_getCakeBomb";
$data="functionId=cakebaker_pk_getCakeBomb&body={}&client=wh5&clientVersion=1.0.0";
$header = array(
"Content-Type: application/x-www-form-urlencoded",
"Content-Length: 74",
"Connection: keep-alive",
"User-Agent: jdapp;",
"Accept-Language: zh-cn",
"Accept: application/json, text/plain, */*"
);
function jdza($url, $header, $data,$cookie){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch,CURLOPT_COOKIE,$cookie);
$re = curl_exec($ch);
curl_close($ch);
//return json_decode($re,true)['data']['tip']
return json_decode($re,true)['data']['result']['tip'];
}
$tmp=jdza($url,$header,$data,$ck);//炸蛋糕返回值结果
echo $tmp;
//这里可以填写你的server酱之类的
file_get_contents("server酱通知地址");
复制代码
|
|