// ==UserScript== // @name jerryking // @namespace http://tampermonkey.net/ // @version 1.9 // @description 考试资料网(ppkao),上学吧,问答库等多平台答案免费查看。 // @author fe // @match *://www.ppkao.com/* // @match *://soapi.ppkao.com/* // @match *://*.shangxueba.com/*.html // @match *://*.asklib.com/* // @connect 81.70.18.168 // @run-at document-end // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_info // @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js // @downloadURL https://update.greasyfork.icu/scripts/449699/jerryking.user.js // @updateURL https://update.greasyfork.icu/scripts/449699/jerryking.meta.js // ==/UserScript== (function() { 'use strict'; var $=unsafeWindow.$, script=GM_info.script, url=location.pathname; //引入layer弹窗css $("head").append(''); $("head").append(''); $("head").append(''); $("body").append('
'); $(".more-button").click(function(){ document.querySelector(".list-container").classList.toggle("active") }); var tm,urls; switch(location.host){ case 'soapi.ppkao.com': console.log("123"); break; case 'www.ppkao.com': tm=$(".single-siti").find(".kt").html() $(".answer").removeAttr("onclick") $('.answer').on('click', '',answer); break; case 'www.asklib.com': break; case location.host.indexOf("shangxueba.com")!=-1?location.host:undefined: tm=$(".ask_title").html() $(".sub_ans_btn").removeAttr("onclick") $('.sub_ans_btn').on('click', '',answer); break; } $('#get_da').on('click', '',answer); function answer(){ var load = unsafeWindow.layer.load(2); GM_xmlhttpRequest({ method: 'POST', url: "http://81.70.18.168/", data:"question="+tm, headers: { "content-type": "application/x-www-form-urlencoded", 'referer':location.href, }, timeout: 5000, onload: function(xhr) { unsafeWindow.layer.close(load); if (xhr.status == 200) { var obj = $.parseJSON(xhr.responseText) || {}; console.log(obj); if(obj.status==200){ var contont=""; //$(".single-siti").find("p").html(obj.data[3])选项暂时不加 switch(location.host){ case 'soapi.ppkao.com': console.log(document.body); break case 'www.ppkao.com': $("#zhangjieList").remove(); $(".tm-bottom").css("height","300px") $("strong.kt").html(obj.question); contont="云端题目:"+obj.question+"
云端选项:
"+obj.option.join('
')+"
云端参考答案:"+obj.answer+"

"+obj.msg $(".tm-bottom").html(contont); break; case 'www.asklib.com': break; case location.host.indexOf("shangxueba.com")!=-1?location.host:undefined: $(".sub_ans_btn").remove(); contont="云端题目:"+obj.question+"
云端选项:
"+obj.option.join('
')+"
云端参考答案:"+obj.answer+"

"+obj.msg $("#div_answer").html(contont); break; } }else{ unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg); } } else if (xhr.status == 203) { obj = $.parseJSON(xhr.responseText) || {}; unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg); } else if (xhr.status == 403) { obj = $.parseJSON(xhr.responseText) || {}; unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg); }else { console.log(xhr.responseText); unsafeWindow.layer?unsafeWindow.layer.msg("题库服务器异常,请稍后再试吧~",{icon: 5}):alert("题库服务器异常,请稍后再试吧~"); } }, ontimeout: function() { unsafeWindow.layer.close(load); unsafeWindow.layer?unsafeWindow.layer.msg("题库服务器异常,请稍后再试吧~",{icon: 5}):alert("题库服务器异常,请稍后再试吧~"); } }); } })();