teslia / BigHongbao-Eleme-PHP

[🐘PHP] 调用www.pinghongbao.com和www.elemhb.top,批量领取饿了么大红包脚本。
MIT License
11 stars 2 forks source link

{"message":"请将信息填写完整"} #1

Closed BadDeveloper2022 closed 6 years ago

BadDeveloper2022 commented 6 years ago

{"message":"请将信息填写完整"}

BadDeveloper2022 commented 6 years ago

`foreach ($copyBtns as $copyBtn){ $url = $copyBtn->getAttribute('data-clipboard-text'); $response = get($url); // 获取真实的红包URL $url = substr($response,strpos($response,'Location:')+strlen('Location:')); $url = substr($url,0,strpos($url,'device_id=')).'device_id='; $result = post(QIANG_HONG_BAO_API,["url"=>trim($url),"mobile"=>$mobile]); // 请求抢红包 echo $result . "\n"; //break; }

// 获取Response的Header部分 function get($url) { $oCurl = curl_init(); curl_setopt($oCurl, CURLOPT_URL,$url); curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($oCurl, CURLINFO_HEADER_OUT, TRUE); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($oCurl, CURLOPT_HEADER, true); curl_setopt($oCurl, CURLOPT_NOBODY, true); $sContent = curl_exec($oCurl); $headerSize = curl_getinfo($oCurl, CURLINFO_HEADER_SIZE); $header = substr($sContent, 0, $headerSize); curl_close($oCurl); return $header; } `

BadDeveloper2022 commented 6 years ago

改成这种就正常了