1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
| import requests import time import smtplib import copy import json import os from datetime import datetime from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart import platform
urls = { 641: "https://cmt3.research.microsoft.com/api/odata/IJCAI2025/ReviewViews(641)", 5149: "https://cmt3.research.microsoft.com/api/odata/IJCAI2025/ReviewViews(5149)", 15758: "https://cmt3.research.microsoft.com/api/odata/IJCAI2025/ReviewViews(15758)", 19890: "https://cmt3.research.microsoft.com/api/odata/IJCAI2025/ReviewViews(19890)", }
last_scores = {}
log_data = { "start_time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "papers": {}, "errors": [] }
log_file = "ijcai_monitor_log.json"
if os.path.exists(log_file): try: with open(log_file, "r", encoding="utf-8") as f: log_data = json.load(f) except Exception as e: print(f"无法加载现有日志文件: {e}")
def update_log(): try: with open(log_file, "w", encoding="utf-8") as f: json.dump(log_data, f, ensure_ascii=False, indent=2) except Exception as e: print(f"无法更新日志文件: {e}")
cookies = { "MC1": "GUID=44928b063b3947518a67995891bf0044&HASH=4492&LV=202504&V=4&LU=1744614339104", ".TRACK": "1", ".ROLE": "Author", ".AspNetCore.Cookies": "CfDJ8JC1yWmjADxLvSP8DVdQ7PM9h9aXhei2M9X2n1gyKZDAzln5XwsqmKIfwA7qkbms31Y_5wMn76scpSspYkqF3VYwSt7u5lNTN21OIC97gNoumKnQMF1fI1-xerQAvNLX29vtm69sC-a0JdmHODOWNkq6L7FvjwH3ABskXLX09Y9VBLsVGuliIZhKXo0nuTkQUHDF4wqhxbuS6X3YlVnGv5DEcDDzes5lQzjWnfPXilfObgRwz1fCXZIstCbtNdZNutC7m2OfJtYP0GdssaJXQLxONo5IZjFoiVae-90jdRR-" }
headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36", "Accept": "application/json, text/plain, */*", "Accept-Language": "en-US,en;q=0.9", "Referer": "https://cmt3.research.microsoft.com/IJCAI2025/Submission/Index", "Origin": "https://cmt3.research.microsoft.com" }
if platform.system() == "Windows": proxies = None else: proxies = None
def send_email(subject, body): sender = "" receiver = "" password = ""
msg = MIMEMultipart() msg["From"] = sender msg["To"] = receiver msg["Subject"] = subject msg.attach(MIMEText(body, "plain"))
try: server = smtplib.SMTP("smtp.office365.com", 587) server.starttls() server.login(sender, password) server.sendmail(sender, receiver, msg.as_string()) server.quit() print("📧 Email sent successfully!") except Exception as e: print(f"❌ Email send failed: {e}")
while True: for rid, url in urls.items(): try: response = requests.get(url, headers=headers, cookies=cookies, proxies=proxies, timeout=10) if response.status_code == 200: data = response.json() if str(rid) not in log_data["papers"]: log_data["papers"][str(rid)] = { "title": data.get("SubmissionTitle", "Unknown Title"), "score_history": [], "last_check": datetime.now().strftime("%Y-%m-%d %H:%M:%S") } for question in data.get("Questions", []): if question.get("Order") == 7: new_value = question.get("Answers", [{}])[0].get("Value") print(f"[{rid}] {new_value}", end="") log_data["papers"][str(rid)]["last_check"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") if rid not in last_scores: last_scores[rid] = new_value log_data["papers"][str(rid)]["score_history"].append({ "time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "score": new_value, "type": "initial" }) elif new_value != last_scores[rid]: old = last_scores[rid] last_scores[rid] = new_value title = data.get("SubmissionTitle", "Unknown Title") log_data["papers"][str(rid)]["score_history"].append({ "time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "score": new_value, "previous_score": old, "type": "change" }) msg = ( f"🔔 Score Changed!\n\n" f"Paper ID: {rid}\n" f"Title: {title}\n" f"Old Score: {old}\n" f"New Score: {new_value}\n" f"Link: {url}" ) print(msg) send_email("IJCAI2025 - Review Score Changed", msg) else: print(f" - No change") break print("") else: error_msg = f"Failed to fetch {rid}, Status code: {response.status_code}" print(error_msg) log_data["errors"].append({ "time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "paper_id": rid, "error": error_msg }) except Exception as e: error_msg = f"[Error] {rid} -> {e}" print(error_msg) log_data["errors"].append({ "time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "paper_id": rid, "error": str(e) }) update_log()
print(f"\n[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] 等待下一次检查...\n") time.sleep(100)
|