// ==UserScript== // @name 奥鹏教师教育网刷课2021 // @version 1.30 // @description 奥鹏教师教育网自动学习 // @author why3303 // @match *://*.ourteacher.com.cn/* // @grant none // @namespace https://greasyfork.org/users/728857 // @downloadURL https://update.greasyfork.icu/scripts/420376/%E5%A5%A5%E9%B9%8F%E6%95%99%E5%B8%88%E6%95%99%E8%82%B2%E7%BD%91%E5%88%B7%E8%AF%BE2021.user.js // @updateURL https://update.greasyfork.icu/scripts/420376/%E5%A5%A5%E9%B9%8F%E6%95%99%E5%B8%88%E6%95%99%E8%82%B2%E7%BD%91%E5%88%B7%E8%AF%BE2021.meta.js // ==/UserScript== (function() { 'use strict'; window.alert = function(){}//魔法,禁止alert弹窗,希望有用 var href = location.href var localUsername var localPassport if(document.cookie.indexOf("localUsername") == -1){//初次使用,将账号密码存入cookie。并读取账号密码供登录 localUsername = prompt("请输入奥鹏账号(只有一次机会不要输错)","") localPassport = prompt("请输入密码","") document.cookie = "localUsername="+localUsername+";expires=Thu, 18 Dec 2043 12:00:00 GMT;domain=.ourteacher.com.cn;path=/" document.cookie = "localPassport="+localPassport+";expires=Thu, 18 Dec 2043 12:00:00 GMT;domain=.ourteacher.com.cn;path=/" }else{ var tempStr = document.cookie; localUsername=tempStr.split("localUsername=")[1].split(";")[0]; localPassport=tempStr.split("localPassport=")[1].split(";")[0]; } if(href == "http://www.ourteacher.com.cn/" || href == "https://www.ourteacher.com.cn/"){//主页 window.location.href = "https://passport.ourteacher.com.cn/Account/LoginIndex/" } else if(href.indexOf("passport.ourteacher.com.cn/Account/LoginIndex") != -1){//登录页面 document.getElementById("aw-login-user-name").value = localUsername document.getElementById("aw-login-user-password").value = localPassport document.getElementById("login_submit").click(); } else if(href.indexOf("WorkRoom/Index") != -1 || href == "https://activity.ourteacher.com.cn/"){//工作室页面 setTimeout(function(){ window.location.href = document.getElementById("goLearn").href },2000) } else if(href.indexOf("Activity/Index?ActivitiesID=")!=-1){//选择课程页面 var temp1,temp2 var courseList var chapterList = document.getElementsByClassName("news-list news-list1")[0].children for(temp1 = 0; temp1 < chapterList.length; temp1++){ //遍历所有课程,找到第一门未完成课程并进入 courseList = chapterList[temp1].getElementsByClassName("er")[0].getElementsByClassName("clearfix") for(temp2=0;temp2