njuCoursesPart1

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

目前為 2015-03-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name        njuCoursesPart1
// @namespace   http://handsomeone.com
// @description 补选南京大学的通识课(上)
// @include     http://*.nju.edu.cn:8080/jiaowu/student/elective/courseList.do?method=discussRenewCourseList&campus=*
// @version     2
// @grant       none
// ==/UserScript==
domain = window.location.hostname.slice(0, - 11);
inputs = document.getElementsByTagName('input');
campus = document.getElementById('campusList').options[document.getElementById('campusList').selectedIndex].value;
if (inputs.length == 1) {
  window.location.href = 'http://' + domain + '.nju.edu.cn:8080/jiaowu/student/elective/courseList.do?method=discussRenewCourseList&campus=' + campus;
} 
else {
  luck = inputs[parseInt(Math.random() * (inputs.length - 1))];
  name = luck.parentNode.parentNode.childNodes[2].innerHTML;
  if (localStorage.i) {
    localStorage.i = eval(localStorage.i) + 1;
    localStorage.n += ' ' + name;
  } 
  else {
    localStorage.i = 1;
    localStorage.n = name;
  }
  window.location.href = 'http://' + domain + '.nju.edu.cn:8080/jiaowu/student/elective/courseList.do?method=submitDiscussRenew&classId=' + luck.value + '&campus=' + campus;
}

QingJ © 2025

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