您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name 传智播客自动搜题 // @namespace http://stu.ityxb.com/writePaper/busywork/* // @version 3 // @description try to take over the world! // @author 广东东软学院林鑫松同学 // @match http://stu.ityxb.com/writePaper/busywork/* // @grant GM_xmlhttpRequest // @connect * // ==/UserScript== var questionObj; var radioDiv; var total = 0;//题目总数 var index = 0;//搜题索引 window.onload = function(){ questionObj = document.getElementsByClassName("question-title-box"); total = questionObj.length; find(questionObj[index].innerText); var bgdiv = document.getElementById("writeQuestion"); bgdiv.style.background = "url('https://s1.ax1x.com/2020/10/09/0BX4xI.png')"; } function find(q){ GM_xmlhttpRequest({ method: 'POST', url: 'http://api.902000.xyz:88/wkapi.php', headers: { 'Content-type': 'application/x-www-form-urlencoded' }, data: 'q='+ encodeURIComponent(q), timeout: 2000, onload:function(xhr) { var str = xhr.responseText; console.log(index+","+str); var open = str.indexOf("answer"); str = str.substring(open); open = str.indexOf("answer") + 9; var end = str.indexOf(",") - 1; var ans = str.substring(open,end); questionObj[index].innerText += "答案:"+ans; questionObj[index].style.color = "red"; questionObj[index].style.fontSize = "28px"; if(index < total - 1) { setTimeout(function (){ index = index + 1; find(questionObj[index].innerText); }, 1000); } } }) }