添加 'mcbbs/fetch-emerald.user.js'
This commit is contained in:
parent
e4c11143aa
commit
ef0c1c813d
32
mcbbs/fetch-emerald.user.js
Normal file
32
mcbbs/fetch-emerald.user.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name 自动抓取用户信息
|
||||||
|
// @namespace https://miaowoo.cc/
|
||||||
|
// @version 0.1
|
||||||
|
// @description 自动抓取用户信息
|
||||||
|
// @author MiaoWoo
|
||||||
|
// @match https://www.mcbbs.net/forum.php?mod=viewthread&tid=**
|
||||||
|
// @match https://www.mcbbs.net/thread-**-*-*.html
|
||||||
|
// @grant none
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function readUserInfo(user){
|
||||||
|
var userline = user.querySelector('a.xw1');
|
||||||
|
if (!userline) return;
|
||||||
|
var uid = userline.href.split('uid=')[1];
|
||||||
|
var username = userline.innerText;
|
||||||
|
var glod = user.querySelectorAll('dl.pil')[0].children[1].innerText;
|
||||||
|
var emerald = user.querySelectorAll('dl.pil')[0].children[3].innerText;
|
||||||
|
fetch('https://reward.yumc.pw/mcbbs/update/uid/'+uid+'/username/'+username+'/glod/'+parseInt(glod)+'/emerald/'+parseInt(emerald)).then(function(response) {
|
||||||
|
return response.json();
|
||||||
|
}).then(function(result) {
|
||||||
|
console.log(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function readAllUserInfo(){
|
||||||
|
document.querySelectorAll('div.pls').forEach(readUserInfo);
|
||||||
|
}
|
||||||
|
setTimeout(readAllUserInfo, 200);
|
||||||
|
})();
|
Loading…
Reference in New Issue
Block a user