jerryking

考试资料网(ppkao),上学吧,问答库等多平台答案免费查看。

  1. // ==UserScript==
  2. // @name jerryking
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.9
  5. // @description 考试资料网(ppkao),上学吧,问答库等多平台答案免费查看。
  6. // @author fe
  7. // @match *://www.ppkao.com/*
  8. // @match *://soapi.ppkao.com/*
  9. // @match *://*.shangxueba.com/*.html
  10. // @match *://*.asklib.com/*
  11. // @connect 81.70.18.168
  12. // @run-at document-end
  13. // @grant unsafeWindow
  14. // @grant GM_xmlhttpRequest
  15. // @grant GM_info
  16. // @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21. var $=unsafeWindow.$,
  22. script=GM_info.script,
  23. url=location.pathname;
  24. //引入layer弹窗css
  25. $("head").append('<script src="https://lib.baomitu.com/layui/2.6.8/layui.js"></script>');
  26. $("head").append('<link href="https://lib.baomitu.com/layui/2.6.8/css/layui.css" rel="stylesheet">');
  27. $("head").append('<style> .list-container { position: fixed; right: 10px; bottom: 10px;z-index:99999; } .list-container.active .more-button-list { opacity: 1; transform: scale(1) } .list-container.active .more-button-list-item { -webkit-animation: fadeInItem .6s .2s forwards; animation: fadeInItem .6s .2s forwards } .list-container.active .more-button-list-item:nth-child(2) { -webkit-animation-delay: .4s; animation-delay: .4s } .list-container.active .more-button-list-item:nth-child(3) { -webkit-animation-delay: .6s; animation-delay: .6s } .list-container.active .more-button-list-item:nth-child(4) { -webkit-animation-delay: .8s; animation-delay: .8s } .list-container.active .more-button { -webkit-animation: onePulse .6s forwards linear; animation: onePulse .6s forwards linear } .list-container.active .menu-icon-wrapper { transform: rotate(-45deg) } .list-container.active .menu-icon-line.first { transform: rotate(-90deg) translateX(1px) } .list-container.active .menu-icon-line.last { transform: rotate(-90deg) translateX(-1px) } .more-button { background-color: #5c67ff; box-shadow: 0 0 0 4px rgba(92, 103, 255, 0.3); border-radius: 50%; width: 50px; height: 50px; border: 0; padding: 0; cursor: pointer; transition: .2s ease-in; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; z-index: 2 } .more-button:hover, .more-button:focus { box-shadow: 0 0 0 8px rgba(92, 103, 255, 0.3); background-color: #4854ff } .more-button:focus { outline: 0 } .more-button-list { background-color: #fff; border-radius: 8px; list-style-type: none; width: 140px; /* height: 170px; */ box-shadow: 0 0 4px 4px rgba(150, 157, 249, 0.16); padding: 0; padding: 6px; position: absolute; right: 24px; bottom: 0; opacity: 0; transform: scale(0); transform-origin: bottom right; transition: all .3s ease .1s } .more-button-list li { opacity: 0 } .more-button-list-item { display: flex; align-items: center; color: #1c3991; padding: 10px; border-radius: 4px; cursor: pointer; position: relative; transition: .2s ease-in; transform: translatex(-10px) } .more-button-list-item:hover { color: #5c67ff } .more-button-list-item:after { content: ""; position: absolute; height: 1px; width: calc(100% - 24px); left: 12px; bottom: 0; background-color: rgba(132, 160, 244, 0.1) } .more-button-list-item:last-child:after { display: none } .more-button-list-item svg { width: 18px; height: 18px } .more-button-list-item span { display: inline-block; line-height: 20px; font-size: 14px; margin-left: 8px } @-webkit-keyframes onePulse { 0% { box-shadow: 0 0 0 0 rgba(92, 103, 255, 0.3) } 50% { box-shadow: 0 0 0 12px rgba(92, 103, 255, 0.1) } 100% { box-shadow: 0 0 0 4px rgba(92, 103, 255, 0.3) } } @keyframes onePulse { 0% { box-shadow: 0 0 0 0 rgba(92, 103, 255, 0.3) } 50% { box-shadow: 0 0 0 12px rgba(92, 103, 255, 0.1) } 100% { box-shadow: 0 0 0 4px rgba(92, 103, 255, 0.3) } } @-webkit-keyframes fadeInItem { 100% { transform: translatex(0px); opacity: 1 } } @keyframes fadeInItem { 100% { transform: translatex(0px); opacity: 1 } } .socials { position: fixed; bottom: 16px; right: 16px; display: flex; align-items: center } .social-link { color: #fff; display: flex; align-items: center; cursor: pointer; text-decoration: none; margin-right: 12px } .menu-icon-wrapper { border-radius: 2px; width: 20px; height: 20px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: transform 330ms ease-out } .menu-icon-line { background-color: #fff; border-radius: 2px; width: 100%; height: 2px } .menu-icon-line.half { width: 50% } .menu-icon-line.first { transition: transform 300ms cubic-bezier(0.52, -0.8, 0.52, 0.52); transform-origin: right } .menu-icon-line.last { align-self: flex-end; transition: transform 300ms cubic-bezier(0.52, -0.8, 0.52, 0.52); transform-origin: left } </style>');
  28. $("body").append('<div class="list-container"> <button class="more-button" aria-label="Menu Button"> <div class="menu-icon-wrapper"> <div class="menu-icon-line half first"></div> <div class="menu-icon-line"></div> <div class="menu-icon-line half last"></div> </div> </button> <ul class="more-button-list"> <li id="bad_q" class="more-button-list-item"><span>错题反馈</span></li><li id="get_da" class="more-button-list-item"><span>查看答案</span></li> </ul> </div>');
  29. $(".more-button").click(function(){
  30. document.querySelector(".list-container").classList.toggle("active")
  31. });
  32. var tm,urls;
  33. switch(location.host){
  34. case 'soapi.ppkao.com':
  35. console.log("123");
  36. break;
  37. case 'www.ppkao.com':
  38. tm=$(".single-siti").find(".kt").html()
  39. $(".answer").removeAttr("onclick")
  40. $('.answer').on('click', '',answer);
  41. break;
  42. case 'www.asklib.com':
  43. break;
  44. case location.host.indexOf("shangxueba.com")!=-1?location.host:undefined:
  45. tm=$(".ask_title").html()
  46. $(".sub_ans_btn").removeAttr("onclick")
  47. $('.sub_ans_btn').on('click', '',answer);
  48. break;
  49. }
  50. $('#get_da').on('click', '',answer);
  51. function answer(){
  52. var load = unsafeWindow.layer.load(2);
  53. GM_xmlhttpRequest({
  54. method: 'POST',
  55. url: "http://81.70.18.168/",
  56. data:"question="+tm,
  57. headers: {
  58. "content-type": "application/x-www-form-urlencoded",
  59. 'referer':location.href,
  60. },
  61. timeout: 5000,
  62. onload: function(xhr) {
  63. unsafeWindow.layer.close(load);
  64. if (xhr.status == 200) {
  65. var obj = $.parseJSON(xhr.responseText) || {};
  66. console.log(obj);
  67. if(obj.status==200){
  68. var contont="";
  69. //$(".single-siti").find("p").html(obj.data[3])选项暂时不加
  70. switch(location.host){
  71. case 'soapi.ppkao.com':
  72. console.log(document.body);
  73. break
  74. case 'www.ppkao.com':
  75. $("#zhangjieList").remove();
  76. $(".tm-bottom").css("height","300px")
  77. $("strong.kt").html(obj.question);
  78. contont="云端题目:"+obj.question+"<br>云端选项:<br>"+obj.option.join('<br>')+"<br>云端参考答案:"+obj.answer+"<br><br>"+obj.msg
  79. $(".tm-bottom").html(contont);
  80. break;
  81. case 'www.asklib.com':
  82. break;
  83. case location.host.indexOf("shangxueba.com")!=-1?location.host:undefined:
  84. $(".sub_ans_btn").remove();
  85. contont="云端题目:"+obj.question+"<br>云端选项:<br>"+obj.option.join('<br>')+"<br>云端参考答案:"+obj.answer+"<br><br>"+obj.msg
  86. $("#div_answer").html(contont);
  87.  
  88. break;
  89. }
  90. }else{
  91. unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg);
  92. }
  93. } else if (xhr.status == 203) {
  94. obj = $.parseJSON(xhr.responseText) || {};
  95. unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg);
  96. } else if (xhr.status == 403) {
  97. obj = $.parseJSON(xhr.responseText) || {};
  98. unsafeWindow.layer?unsafeWindow.layer.msg(obj.msg,{icon: 5}):alert(obj.msg);
  99. }else {
  100. console.log(xhr.responseText);
  101. unsafeWindow.layer?unsafeWindow.layer.msg("题库服务器异常,请稍后再试吧~",{icon: 5}):alert("题库服务器异常,请稍后再试吧~");
  102. }
  103. },
  104. ontimeout: function() {
  105. unsafeWindow.layer.close(load);
  106. unsafeWindow.layer?unsafeWindow.layer.msg("题库服务器异常,请稍后再试吧~",{icon: 5}):alert("题库服务器异常,请稍后再试吧~");
  107. }
  108. });
  109. }
  110. })();

QingJ © 2025

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