njuCoursesPart1

补选南京大学的通识课(上)

  1. // ==UserScript==
  2. // @name njuCoursesPart1
  3. // @namespace http://handsomeone.com
  4. // @description 补选南京大学的通识课(上)
  5. // @include http://*.nju.edu.cn:8080/jiaowu/student/elective/courseList.do?method=discussRenewCourseList&campus=*
  6. // @version 2.03
  7. // @grant none
  8. // ==/UserScript==
  9. domain = location.hostname.slice(0, - 11);
  10. campus = document.getElementById('campusList').options[document.getElementById('campusList').selectedIndex].value;
  11. inputs = document.getElementsByTagName('input');
  12. if (inputs.length == 1) {
  13. location = location;
  14. }
  15. else {
  16. luck = inputs[parseInt(Math.random() * (inputs.length - 1))];
  17. name = luck.parentNode.parentNode.childNodes[2].innerHTML;
  18. date = luck.parentNode.parentNode.childNodes[4].innerHTML;
  19. // 排除特定日期课程 可自行修改
  20. if (name != localStorage.lastName) {
  21. // 以下用于记录刷出课程 可注释
  22. if (localStorage.i) {
  23. localStorage.i = eval(localStorage.i) + 1;
  24. localStorage.n += ',' + name;
  25. }
  26. else {
  27. localStorage.i = 1;
  28. localStorage.n = name;
  29. }
  30. localStorage.lastName = name;
  31. location = 'http://' + domain + '.nju.edu.cn:8080/jiaowu/student/elective/courseList.do?method=submitDiscussRenew&classId=' + luck.value + '&campus=' + campus;
  32. }
  33. else {
  34. location = location;
  35. }
  36. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址