First commit

master
斐斐 4 years ago
commit a96922952b

@ -0,0 +1,11 @@
# 研究生招生分数查询系统监控器
仅在Windows系统下有效。
本监控器包含两个学校:
* 中国科学技术大学
* 中南财经政法大学
中国科学技术大学监控工作流程为一旦发现页面发生更改则通过Windows Toast发送通知并打开浏览器叫你看一看
中南财经政法大学监控流程为不断尝试登录一旦登录成功并且成绩页面的状态码不是5xx或提示系统内部错误则发送通知并打印网页源代码。
可以根据需要修改代码。
注意中南财经政法大学的需要修改第18行加入你的证件号码的加密文本。想知道这个文本的请通过控制台抓包获取。

@ -0,0 +1,32 @@
#encoding:utf-8
from win10toast import ToastNotifier
import requests as r
import os
import time
toaster = ToastNotifier()
oritxt = r.get('http://yzb2.ustc.edu.cn/cjcx').text
if oritxt.find(u'未开通') == -1:
print(u'[NOTICE] 可能已经可以查分了,帮你打开浏览器,快去看看')
os.system('start http://yzb2.ustc.edu.cn/cjcx')
toaster.show_toast(u"USTC查分网监控器",
u"查分网站内容发生变更时我会通知您,并自动打开浏览器", duration=10)
print(u'[NOTICE] 监控开始')
while True:
time.sleep(15)
os.system('cls')
print(u'http://yzb2.ustc.edu.cn/cjcx:获取中...')
try:
current = r.get('http://yzb2.ustc.edu.cn/cjcx').text
if current == oritxt:
print(time.strftime('[NOTICE] %X\tNO...',time.localtime(time.time())))
else:
os.system('start http://yzb2.ustc.edu.cn/cjcx')
toaster.show_toast(u"监控程序",
u"好像可以查询成绩了,帮你打开浏览器,快去看看", duration=60)
exit()
except KeyboardInterrupt:
exit()
except Exception, e:
print("[ERROR] ", e)

@ -0,0 +1,41 @@
#encoding:utf-8
from win10toast import ToastNotifier
import requests as r
import os
import time
toaster = ToastNotifier()
toaster.show_toast(u"zuel查分网监控器",
u"可以查分的时候我会提醒你~", duration=10)
print(u'[NOTICE] 监控开始')
while True:
time.sleep(20)
os.system('cls')
try:
print(u'[NOTICE] 登陆中...')
login_session = r.post('http://stu.znufe.yanzhao.edu.cn/ssxscx.do', {'zjhm':'!此处填写你的证件号码加密后的文本。你可以通过控制台抓包获取!', 'ksbh':''})
if login_session.text.find(u'登录信息有误,请重新填写') != -1:
#print(login_session.text)
print(u'[NOTICE] 登陆失败,信息未录入...')
continue
ybb_cookies = login_session.cookies
print(u'[NOTICE] 登陆成功')
login_get_score = r.get('http://stu.znufe.yanzhao.edu.cn/showPreliminaryScoreInfo.do', cookies=ybb_cookies)
pos = login_get_score.text.find(u'500 - 系统内部错误')
if pos != -1 or login_get_score.status_code / 100 == 5:
print(login_get_score.text)
print(u'[NOTICE] 成绩未录入20秒后重新登陆(HTTP %d)' % login_get_score.status_code)
else:
print(u'[NOTICE] 成绩好像有了!帮你打开浏览器,快去看看!!!')
print(u'[NOTICE] 成绩信息:')
print(login_get_score.text)
os.system('start http://stu.znufe.yanzhao.edu.cn/ssxscx.do')
toaster.show_toast(u"zuel查分网监控器",
u"成绩好像有了!快去看看!!", duration=10)
os.system('pause')
except KeyboardInterrupt:
exit()
except Exception, e:
print("[ERROR] ", e)