// ==UserScript== // @name 百度贴吧自动签到 // @namespace http://tampermonkey.net/ // @version v2024-05-19 // @description 打开脚本刷新一下 // @author 贴吧id o.p._p qq:2489564719 // @match https://tieba.baidu.com/* // @match https://mooc1.chaoxing.com/mooc-ans/mycourse/* // @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org // @grant none // @license All Rights Reserved // @downloadURL none // ==/UserScript== let a,url="https://tieba.baidu.com",index=0;function post1(){for(let e=1;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)})}$.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"));const o=new MutationObserver(()=>{t.contentDocument.querySelectorAll(".forum_table tr:not(.forum_table tr:nth-child(1))")[0]&&(a=+t.contentDocument.querySelector("#j_pagebar > div > a:nth-child(4)").getAttribute("href").slice(t.contentDocument.querySelector("#j_pagebar > div > a:nth-child(4)").getAttribute("href").lastIndexOf("=")+1)+1,t.remove(),o.disconnect())});o.observe(t.contentDocument,{childList:!0,subtree:!0}),t.contentWindow.document.write(e),setTimeout(function(){post1()},3e3)}),setTimeout(()=>{$(".top-sec").html("签到列表:"+Array.from(window.concernList))},8e3);