// ==UserScript== // @name 贴吧签到助手 // @namespace https://hsmyldk.top // @version 0.1 // @description 自动签到,签到速度取决于未签到的吧的数量和网速 // @author Hsmyldk // @match https://tieba.baidu.com // @match https://tieba.baidu.com/index.html // @grant none // @downloadURL none // ==/UserScript== var bas = []; $('#moreforum').trigger(new Event('mouseenter')); $('#moreforum').trigger(new Event('click')); var items = document.getElementsByClassName('unsign'); for (var i = 0; i < items.length; i++) { bas.push(items[i].textContent); } qd(); function qd() { if (bas.length != 0) { var xml = new XMLHttpRequest(); xml.open("POST", "https://tieba.baidu.com/sign/add?ie=utf-8&kw=" + bas[0]) xml.send(); xml.onload = e => { console.log(bas[0]) bas.splice(0, 1); qd(); } } else { var a = document.createElement('a'); a.href = "#"; a.className = "u-f-item sign"; a.innerHTML = "已签到"; document.getElementById('likeforumwraper').append(a); } }