diff --git a/mcbbs/fetch-emerald.user.js b/mcbbs/fetch-emerald.user.js index 70d9d25..ec6dd7f 100644 --- a/mcbbs/fetch-emerald.user.js +++ b/mcbbs/fetch-emerald.user.js @@ -1,12 +1,13 @@ // ==UserScript== // @name 自动抓取用户信息 // @namespace https://miaowoo.cc/ -// @version 0.4 +// @version 0.1.5 // @description 自动抓取用户信息 // @author MiaoWoo // @match https://www.mcbbs.net/forum.php?mod=viewthread&tid=** // @match https://www.mcbbs.net/thread-**-*-*.html // @match https://www.mcbbs.net/home.php?mod=space&uid=** +// @run-at document-start // @grant none // ==/UserScript== @@ -48,7 +49,8 @@ var emerald = scoreInfo.children[5].innerText.replace(scoreInfo.children[5].children[0].innerText, '') postUserInfo(uid, username, glod, emerald) } - setTimeout(location.pathname == "/home.php" ? readSingleUserInfo : readAllUserInfo, 200) + window.alert = function (...args) { console.log(args) } + setTimeout(location.pathname == "/home.php" ? readSingleUserInfo : readAllUserInfo, 2000) function addiFrame(url) { var body = document.getElementsByTagName("body") var div = document.createElement("div") @@ -56,15 +58,7 @@ document.body.appendChild(div) } function updateOldUserInfo() { - fetch('https://reward.yumc.pw/mcbbs/updateList').then(function (response) { - return response.json() - }).then(function (result) { - if (result.code == 200 && result.data && result.data.length) { - result.data.forEach(function (user) { - addiFrame(`https://www.mcbbs.net/home.php?mod=space&uid=${user.uid}`) - }) - } - }) + fetch('https://reward.yumc.pw/mcbbs/updateList') } async function post(method, data) { return await fetch('https://reward.yumc.pw/mcbbs/' + method, {