Last active
June 17, 2016 01:43
-
-
Save fei-ke/ef9b55716ef1518565af to your computer and use it in GitHub Desktop.
字幕组签到
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_cookieFileLocation = './cookie.txt'; | |
$login_url="http://www.zimuzu.tv/User/Login/ajaxLogin"; | |
$sign_url="http://www.zimuzu.tv/user/sign"; | |
$hotkeyword_url="http://www.zimuzu.tv/public/hotkeyword"; | |
$get_cur_user_top_info_url="http://www.zimuzu.tv/user/login/getCurUserTopInfo"; | |
$ch = curl_init(); | |
$data = array ( | |
'account'=>'username',//用户名 | |
'password'=>'password'//密码 | |
); | |
curl_setopt($ch, CURLOPT_URL, $login_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_setopt($ch, CURLOPT_HTTPHEADER,array('description:just want doSign,don\'t block me please')); | |
curl_setopt($ch, CURLOPT_POST, 1);//启用POST提交 | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data ); | |
curl_setopt($ch, CURLOPT_COOKIEFILE, $_cookieFileLocation); // 讀取 | |
curl_setopt($ch, CURLOPT_COOKIEJAR, $_cookieFileLocation); // 寫入 | |
$response = curl_exec($ch); | |
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
print_r($httpCode); | |
print_r($response); | |
curl_setopt($ch,CURLOPT_COOKIE,$cookie); | |
curl_setopt($ch, CURLOPT_URL, $sign_url); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, null); | |
curl_exec($ch); | |
curl_setopt($ch,CURLOPT_COOKIE,$cookie); | |
curl_setopt($ch, CURLOPT_URL, $hotkeyword_url); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, null); | |
$response = curl_exec($ch); | |
curl_setopt($ch,CURLOPT_COOKIE,$cookie); | |
curl_setopt($ch, CURLOPT_URL, $get_cur_user_top_info_url); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, null); | |
$response = curl_exec($ch); | |
curl_close($ch); | |
$sign_result = json_decode($response); | |
if($sign_result->status==1){ | |
sendMail("签到成功"); | |
}else{ | |
sendMail("签到失败"); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment