// ==UserScript== // @name 百度贴吧自动签到 // @namespace http://tampermonkey.net/ // @version 2024-03-14 // @description 打开脚本刷新一下 // @author 贴吧id o.p._p // @match https://tieba.baidu.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org // @grant none // @license All Rights Reserved // @downloadURL none // ==/UserScript== setTimeout(()=>{const url="https://tieba.baidu.com";let index=0;$.post(`${url}/f/like/mylike?v=${(new Date).getTime()}`,{v:`${(new Date).getTime()}`}).then(e=>{const t=document.createElement("iframe");document.body.insertBefore(t,document.querySelector("#com_userbar")),window.concernList=new Set;const o=new MutationObserver(()=>{const e=t.contentDocument.querySelectorAll(".forum_table tr:not(.forum_table tr:nth-child(1))");if(e[0]){for(let t of e)concernList.add(t.querySelector("a[title]").title);for(let e of concernList)setTimeout(()=>{$.get("https://tieba.baidu.com/dc/common/tbs",function(t){$.post(`${url}/sign/add`,{kw:`${e}`,ie:" utf-8",tbs:`${JSON.parse(t).tbs}`})})},1500*index++);t.remove(),o.disconnect()}});o.observe(t.contentDocument,{childList:!0,subtree:!0}),t.contentWindow.document.write(e)});},0)