QQ群成员管理
// ==UserScript==
// @name QQ群成员管理
// @namespace yeyu
// @version 0.1
// @description 批量选中删除前20成员,批量获取Q号
// @author 夜雨
// @match http*://qun.qq.com/member*
// @grant GM_setClipboard
// @license MIT
// @icon https://www.google.com/s2/favicons?sz=64&domain=im.qq.com
// ==/UserScript==
(function() {
'use strict';
var st = function() {
console.log("群成员已经加载");
document.querySelector("#groupMemberTit").innerHTML = document.querySelector("#groupMemberTit").innerHTML + `<button id="selectMember" class="add-member" >选中前20</button>`;
let InputBox = document.getElementById("selectMember");
InputBox.addEventListener("click", function(ev) {
document.querySelectorAll(".list tr .td-right input").forEach((item,index)=>{
if(index<20){item.checked = !item.checked}
});
})
}
var getQQ = function() {
var res = '<textarea rows="10">';
var gmb = document.getElementById("groupMember");
var mblist = gmb.getElementsByClassName('list');
for (var i = 0; i < mblist.length; i++) {
var mbtrs = mblist[i].getElementsByTagName('tr');
for (var j = 0; j < mbtrs.length; j++) {
res += mbtrs[j].className.replace('mb mb', '') + '\n'
}
}
console.log(res);
gmb.innerHTML = res + `</textarea></br>`;
}
setInterval(()=>{
let InputBox = document.getElementById("selectMember");
if(!InputBox){
st();
}
}, 3000)
setTimeout(()=>{
document.querySelector("#headerNav").innerHTML = document.querySelector("#headerNav").innerHTML +
`<li><a id="la" style="color: red;" href="javascript:void;">获取页面群成员</a></li>`;
let la = document.getElementById("la");
la.addEventListener("click", function(ev) {
getQQ();
})
},3000)
})();