研招网监控器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

41 lines
1.5 KiB

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