diff --git a/Judger.php b/Judger.php index 94dc572..9c8a15c 100644 --- a/Judger.php +++ b/Judger.php @@ -55,6 +55,8 @@ private function _login($handle, $pass, $vcid) } private function grab($all_data) { + $oj = $all_data['oj']; + $handle = $all_data['handle']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $all_data['site']); @@ -63,8 +65,8 @@ private function grab($all_data) { $headers = array(); - curl_setopt($ch, CURLOPT_COOKIEFILE, babel_path("Cookies/hdu_team0670.cookie")); - curl_setopt($ch, CURLOPT_COOKIEJAR, babel_path("Cookies/hdu_team0670.cookie")); + curl_setopt($ch, CURLOPT_COOKIEFILE, babel_path("Cookies/{$oj}_{$handle}.cookie")); + curl_setopt($ch, CURLOPT_COOKIEJAR, babel_path("Cookies/{$oj}_{$handle}.cookie")); $result = curl_exec($ch); curl_close($ch); @@ -111,6 +113,7 @@ public function judge($row) $pass = $judger['password']; $this->_login($handle, $pass, $row['vcid']); $response = $this->_loginAndGet("http://acm.hdu.edu.cn/contests/contest_status.php?cid=".$row['vcid']."&user=".$handle."&pid=".$iid, $handle, $pass, $row['vcid']); + Log::debug($response); } if(isset($row['vcid'])) { $hduRes = HTMLDomParser::str_get_html($response, true, true, DEFAULT_TARGET_CHARSET, false); diff --git a/babel.json b/babel.json index aeb5ce3..2032d93 100644 --- a/babel.json +++ b/babel.json @@ -6,7 +6,7 @@ "description": "HDU Interface for NOJ", "license": "MIT", "repository":"https://github.com/NJUPTAAA/NOJ_Extension_HDU", - "version":"0.3.8", + "version":"0.3.9", "website":"http://acm.hdu.edu.cn/", "custom":{ "css":"resources/custom.css"