// ==UserScript== // @name 超星分数查询(全班) // @namespace dandanmuaa@gmail.com // @version 1.0 // @description 超星分数查询(全班) // @author dandanla // @match *://*.chaoxing.com/* // @run-at document-end // @connect 42.192.47.62 // @grant GM_xmlhttpRequest // @require https://lib.baomitu.com/jquery/3.6.0/jquery.min.js // @antifeature ads // @antifeature membership // ==/UserScript== var conf = { title: "超星分数查询(油猴中文网首发)", TimeOut:5000, }; $('head').append(''); $.getScript("https://lib.baomitu.com/layui/2.6.8/layui.js", function(data, status, jqxhr) { layui.use('element', function(){ var element = layui.element; }); var url = window.location.href; if (url.match("/mycourse")){ var courseid = url.match(/courseid=(\d+)/i)[1] var clazzid = url.match(/clazzid=(\d+)/i)[1] console.log(courseid,clazzid) layer.closeAll(); show(); $(".start").click(function() { chafen(courseid,clazzid); }) }; }); var chafen = (courseid,clazzid)=>{ GM_xmlhttpRequest({ method: 'GET', url: "http://42.192.47.62:8080/cha?courseId="+courseid+"&classId="+clazzid, timeout: conf.TimeOut, onload: function(xhr) { if (xhr.status == 200) { var el=""; var obj = JSON.parse(xhr.responseText) || {}; document.querySelector("#msg > div").innerHTML = '共获取'+obj.total+'位同学分数'; var content = document.getElementsByClassName("layui-card-body")[0] if (obj.body) { el = '' for(let i=0;i' + obj.head[i] + '' } el = el + '' $("#content>table>tbody").append($(el)); for(let i=0;i' + obj.body[i][k] + '' } el = el + '' $("#content>table>tbody").append($(el)); } } window.open("https://github.com/Dandanla/cxScore") } } }); } var show = ()=>{ layer.open({ type: 1, area: ['800px', '500px'], offset: 'rt', id: 'msgt', closeBtn: 1, title: conf.title, shade: 0, maxmin: true, anim: 2, content: '
'+ '

公告

内侧版本,制作不易
可以给github点个star支持一下
地址:https://github.com/Dandanla/cxScore
' +'
    ' }); }