Greasy Fork is available in English.
完善中的中国大学慕课辅助,当前完成了视频,答题(SPOC暂未完成)。
// ==UserScript== // @name 中国大学慕课K辅助----视频,考试(测试中)白嫖版 // @namespace http://tampermonkey.net/ // @version 0.3 // @description 完善中的中国大学慕课辅助,当前完成了视频,答题(SPOC暂未完成)。 // @author K // @match https://www.icourse163.org/* // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js // @grant none // ==/UserScript== //============================================= var css = '.h500{ height:500px !important; }'; css += '.h50{height:18px !important;width:160px!important;}'; loadStyle(css); function loadStyle(css) { var style = document.createElement('style'); style.type = 'text/css'; style.rel = 'stylesheet'; style.appendChild(document.createTextNode(css)); var head = document.getElementsByTagName('head')[0]; head.appendChild(style); } //============================================= // ==/UserScript== ( function() { 'use strict'; function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) { return unescape(arr[2]) } else { alert("cookie不存在!"); return "" } } window.getCookie=getCookie; function zxkpost(url, para,succ) { var xhr = new XMLHttpRequest(); xhr.open('post', url); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.send(para.split("\n").join("&")); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { succ(xhr.responseText) } } } window.zxkpost=zxkpost; function postSync(url, para) { return new Promise(function(succ, fail) { var xhr = new XMLHttpRequest(); xhr.open('post', url); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.send(para.split("\n").join("&")); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { succ(xhr.responseText) } } }) } setTimeout(function() { $("body").append('<div class="zc1" title="觉得碍眼,双击试试" style="position:absolute;height:500px; top:200px;z-index: 1000001; left:0px; width:350px; background:#8a9bca; cursor:move;" id="Drigging"><div style="text-align: center;color:white">欢迎使用K辅助-白嫖内测版</div>'+ '<div id="login"><iframe src="https://ans.oyes.tech/h5/" width="100%" style="height:500px;" class="zc1" id="zxkif"></iframe></div><div id="zxkmain"></div></div> '); if (localStorage.getItem("showmini")==2){ $(".zc1").toggleClass("h50"); } $("#Drigging").on('dblclick',function(e){ $(".zc1").toggleClass("h50"); localStorage.setItem("showmini",$('.zc1.h50').length); }); $("#Drigging").mousedown(function (e) { window.iDiffX = e.pageX - $(this).offset().left; window.iDiffY = e.pageY - $(this).offset().top; $(document).mousemove(function (e) { $("#Drigging").css({ "left": (e.pageX - window.iDiffX), "top": (e.pageY - window.iDiffY) }); }); }); $("#Drigging").mouseup(function () { $(document).unbind("mousemove"); }); }, 1000) window.toChild = function(ifname,data){ document.getElementById(ifname).contentWindow.postMessage({res:0,data:data},"https://ans.oyes.tech"); } window.addEventListener('message', function(e) { var json = e.data;if (json.a == "js") { eval(json.data); } }, false); })();