(也许可以放在 Dev,但不确定,所以就放在这里了)
在管理论坛时,我通过关闭和归档旧的群组成员资格请求 PM 来清理收件箱,手动操作让我感到厌烦。
我在此呈上用户脚本,为您代劳!您只需右键单击,选择“Tampermonkey”选项,然后运行“关闭和归档”脚本!
代码:
// ==UserScript==
// @name 关闭和归档
// @namespace http://tampermonkey.net/
// @version 2025-02-14
// @description 运行脚本时关闭和归档当前打开的主题/私人消息
// @author Firepup Sixfifty
// @match https://=hostname=/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=amcforum.wiki
// @grant none
// @run-at context-menu
// ==/UserScript==
(function() {
'use strict';
fetch(`https://${window.location.hostname}/t/${window.location.pathname.split('/')[3]}/status`, {
"headers": {
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"accept": "application/json",
"x-csrf-token": document.querySelector("[name='csrf-token']").content
},
"body": "status=closed&enabled=true",
"method": "PUT"
}).then((r)=>{
fetch(`https://${window.location.hostname}/t/${window.location.pathname.split('/')[3]}/status`, {
"headers": {
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"accept": "application/json",
"x-csrf-token": document.querySelector("[name='csrf-token']").content
},
"body": "status=archived&enabled=true",
"method": "PUT"
}).then((r)=>{
fetch(`https://${window.location.hostname}/t/${window.location.pathname.split('/')[3]}/archive-message`, {
"headers": {
"accept": "application/json",
"x-csrf-token": document.querySelector("[name='csrf-token']").content
},
"method": "PUT"
});
})
})
})();