希望这次把那个轮逼彻底屏蔽了
【工具】-屏蔽烦你的id插件
版主: huangchong
-
- 论坛精英
- 帖子: 5378
- 注册时间: 2022年 8月 30日 14:41
- 昵称(选填): 轮逼鉴定专家
Re: 【工具】-屏蔽烦你的id插件
-
- 论坛精英
- 帖子: 5378
- 注册时间: 2022年 8月 30日 14:41
- 昵称(选填): 轮逼鉴定专家
Re: 【工具】-屏蔽烦你的id插件
大神有什么办法 把轮逼的ID也屏蔽掉啊
supermassive 写了: ↑2022年 8月 9日 14:11 (Huangchong 编辑)https://www.tampermonkey.net/
从春卷老师的脚本改的,桌面端使用方法:
- 安装tampermonkey(Firefox/Chrome/Edge, etc.)
- tampermonkey打开dashboard
已知问题:
- 点+号,新建脚本,copy&paste(覆盖掉TM自己生成的脚本模板)
如果发现bug想要俺修,请确认是最新的脚本.
- 在proflat主题下无效
如何汇报问题
- 1. 确保所有的code全部copy & paste进了油猴
- 2. 你是用的什么浏览器
- 3. 你用的什么主题(控制面板->偏好设置->我的论坛风格)
- 4. 最好有浏览器截图,可以把书签地址栏隐藏,只需要在某个主题下的截图
手机端update:
- 推荐使用Firefox Mobile,同样可以用tampermonkey, https://addons.mozilla.org/en-US/androi ... permonkey/
- 10/17/22, 修复版面上失效的问题
- 7/9/23, 修复无法添加部分含有空格id的问题
代码: 全选
// ==UserScript== // @name NewMitbbs-bot-blocker // @namespace http://tampermonkey.net/ // @version 0.1 // @description Manages and blocks bot generated content. Shamelessly modified from chunjuan's script at https://greasyfork.org/en/scripts/29195-mitbbs-bot-blocker/code, which was inspired by Smalltalk80's original GM script, http://userscripts-mirror.org/scripts/review/78633 // @author Sagittarius A* // @match http://newmitbbs.com/* // @match https://newmitbbs.com/* // @grant GM_addStyle // @run-at document-idle // ==/UserScript== // debugger; (function() { 'use strict'; var storageKey = 'new.mitbbs.blocklist'; function getBlocklist() { var blockList = localStorage.getItem(storageKey); if (blockList === null) { setBlocklist([]); blockList = localStorage.getItem(storageKey); } try { blockList = JSON.parse(blockList); } catch (error) { blockList = []; setBlocklist(blockList); } blockList = Array.isArray(blockList) ? blockList : []; return blockList; } function setBlocklist(idNameList) { // remove duplicate items // todo: babel output for this one doesn't really work, have to revert back to old fashion way // idNameList = [...new Set(idNameList)] var uniqueidNameList = idNameList.filter(function (elem, index, self) { return index === self.indexOf(elem); }); uniqueidNameList = uniqueidNameList.sort(function (a, b) { // defer from localeCompare for better browser support if (a.toLowerCase() < b.toLowerCase()) return -1; if (a.toLowerCase() > b.toLowerCase()) return 1; return 0; }); localStorage.setItem(storageKey, JSON.stringify(uniqueidNameList)); document.getElementById('blockListInput').value = uniqueidNameList; } function getBlockFlag() { var blockFlag = localStorage.getItem(storageKey + '.flag'); if (blockFlag === null) { setBlockFlag(0); blockFlag = localStorage.getItem(storageKey + '.flag'); } // js, just being js return parseInt(blockFlag); } function setBlockFlag(flag) { localStorage.setItem(storageKey + '.flag', flag); } function changePostVisibility() { var blockList = getBlocklist(); var flag = getBlockFlag(); // if list is not empty var counter = 0; if (blockList) { var taolunDiv = document.querySelector('div.forumbg:not(.announcement)'); if(taolunDiv == null) taolunDiv = document.querySelector('div.sn-cat-header:not(.announcement)'); // yeah yeah yeah magic number, whatever // this will miss the first one though, nice try langfang coder var userIDtdNodeList = taolunDiv.querySelectorAll('li.row'); console.log(userIDtdNodeList.length); userIDtdNodeList.forEach(function (td) { // damn, now i miss jquery/zepto var id; if(td.querySelector('div.topic-poster') != null){ id = td.querySelector('div.topic-poster').querySelector('span.username').textContent; console.log("debug 3"); }else if(td.querySelector('div.responsive-show:not([style*="display:none"]') != null){ id = td.querySelector('div.responsive-show:not([style*="display:none"]').querySelector('span.username').textContent; console.log("debug 2"); }else{ console.log("couldn't find td"); } // reset all reply to visible. This is a hack-ish method to fix content not being displayed after userID has been removed from blocklist. // TODO: maybe in the near future, we should keep a local copy of blocklist so that we can compare the changes and show/hide content intelligently, maybe td.style.display = ''; // yeah, nested if statements console.log("op's id is " + id); if (blockList.indexOf(id) > -1) { if (flag) { td.style.display = 'none'; console.log(id + "'s post has been set as invisible"); counter += 1; } else { td.style.display = ''; } } }); counter = flag ? counter : 0; document.getElementById('blockCounter').innerHTML = counter; } } function changeReplyVisibility() { // now we on individual post page var blockList = getBlocklist(); var flag = getBlockFlag(); var counter = 0; var sideBarBG = document.querySelectorAll('div.post.has-profile'); sideBarBG.forEach(function (reply) { // var post = reply.parentElement.parentElement.parentElement.parentElement.parentElement; var userID = reply.querySelector('span.username').textContent; // another magic number! var userMenu = reply.querySelector('strong'); var hasButton = userMenu.querySelector('span.button') !== null; if (!hasButton) { var blockButton = document.createElement('span'); blockButton.setAttribute('class', 'button'); blockButton.innerHTML = ' <button class="addToBlock" title="' + userID + '">屏蔽!</button>'; userMenu.appendChild(blockButton); } if(!flag) userMenu.querySelector('span.button').style.display = 'none'; else userMenu.querySelector('span.button').style.display = ''; // reset all reply to visible. This is a hack-ish method to fix content not being displayed after userID has been removed from blocklist. // TODO: maybe in the near future, we should keep a local copy of blocklist so that we can compare the changes and show/hide content intelligently, maybe reply.style.display = ''; if (blockList.indexOf(userID) > -1) { if (flag) { reply.style.display = 'none'; counter += 1; } else { reply.style.display = ''; } } counter = flag ? counter : 0; document.getElementById('blockCounter').innerHTML = counter; }); var allBlockButton = document.querySelectorAll('.addToBlock'); Array.from(allBlockButton).forEach(function (button) { var userID = button.getAttribute('title'); button.addEventListener('click', function () { var yesBlock = confirm('Block ' + userID + ' ?'); if (yesBlock) { blockList.push(userID); setBlocklist(blockList); document.getElementById('blockListInput').value = getBlocklist().join(); // toggleBlockedContent(); // copy & paste from above code to refresh the page with newly added id sideBarBG.forEach(function (reply) { // var post = reply.parentElement.parentElement.parentElement.parentElement.parentElement; var userID = reply.querySelector('span.username').textContent; // another magic number! var userMenu = reply.querySelector('strong'); var hasButton = userMenu.querySelector('span.button') !== null; if (!hasButton) { var blockButton = document.createElement('span'); blockButton.setAttribute('class', 'button'); blockButton.innerHTML = ' <button class="addToBlock" title="' + userID + '">屏蔽!</button>'; userMenu.appendChild(blockButton); } if(!flag) userMenu.querySelector('span.button').style.display = 'none'; else userMenu.querySelector('span.button').style.display = ''; // reset all reply to visible. This is a hack-ish method to fix content not being displayed after userID has been removed from blocklist. // TODO: maybe in the near future, we should keep a local copy of blocklist so that we can compare the changes and show/hide content intelligently, maybe reply.style.display = ''; if (blockList.indexOf(userID) > -1) { if (flag) { reply.style.display = 'none'; counter += 1; } else { reply.style.display = ''; } } counter = flag ? counter : 0; document.getElementById('blockCounter').innerHTML = counter; }); } }); }); } function toggleBlockedContent() { document.getElementById('isBlocking').checked ? setBlockFlag(1) : setBlockFlag(0); var pageType = locationGuesser(); switch (pageType) { case 1: changeReplyVisibility(); break; case -1: changePostVisibility(); break; } } function locationGuesser() { var pageType = void 0; var url = window.location.href; if (url.indexOf('viewtopic') > -1) { pageType = 1; } else if (url.indexOf('viewforum') > -1) { pageType = -1; } else { pageType = 0; } return pageType; } // callback for when clicking 黑名单 button function changeBlockListVisibility() { var notVisible = document.getElementById('blockListPop').style.display === 'none'; if (notVisible) { // show block list pop up document.getElementById('blockListInput').value = getBlocklist().join(); document.getElementById('blockListPop').style.display = ''; } else { // close block list pop up document.getElementById('blockListPop').style.display = 'none'; // update blocklist when closing the pop up updateBlockList(); } } function updateBlockList() { var newBlockList = document.getElementById('blockListInput').value; //// remove line break, space, trailing comma //newBlockList = newBlockList.replace(/(\r\n|\n|\r)/gm, '').replace(/\s/g, '').replace(/,+$/, ''); // remove line break, trailing comma newBlockList = newBlockList.replace(/(\r\n|\n|\r)/gm, '').replace(/,+$/, ''); newBlockList = newBlockList.split(','); setBlocklist(newBlockList); // re-filter existing content toggleBlockedContent(); } function hideBlockList() { document.getElementById('blockListPop').style.display = 'none'; } function prepPage() { var flag = getBlockFlag(); getBlocklist(); if (flag) { document.getElementById('isBlocking').checked = true; toggleBlockedContent(); } } function pageOnLoad() { // build blocker control gui var blockerDiv = document.createElement('div'); blockerDiv.innerHTML = '<button id="showBlocklist" class="button">黑名单</button><input type="checkbox" id="isBlocking" /><span id="blockCounter" title="Currently Blocked"></span>'; blockerDiv.style.cssText = 'position:fixed; bottom:2em; right:0.5em; width:9em; padding:0.5em; border-radius:0.25em; background-color:#D7EAF9; box-shadow:2px 2px 4px 0px rgba(0,0,0,0.5); text-align:center; cursor:pointer;'; document.body.appendChild(blockerDiv); document.getElementById('showBlocklist').addEventListener('click', changeBlockListVisibility); document.getElementById('blockCounter').style.cssText = 'padding:0 4px; font-weight:bold'; document.getElementById('isBlocking').addEventListener('change', toggleBlockedContent); // block list var blockListDiv = document.createElement('div'); blockListDiv.setAttribute('id', 'blockListPop'); blockListDiv.innerHTML = '<span>修改ID,用逗号分隔,大小写敏感!</span>' + '<br/>' + '<textarea rows="10" cols="40" id="blockListInput" style="background-color:orange;color:black;font-size:10pt;"></textarea>' + '<br/>' + '<button id="updateBlockList">Update</button><span style="width:2em"></span><button id="closePop">Close</button>'; blockListDiv.style.cssText = 'position:fixed; bottom:5.3em; right:0.5em; padding:0.5em; border-radius:0.25em; background-color:#D7EAF9; box-shadow:2px 2px 4px 0px rgba(0,0,0,0.5); text-align:center; display:none'; document.body.appendChild(blockListDiv); document.getElementById('updateBlockList').addEventListener('click', updateBlockList); document.getElementById('closePop').addEventListener('click', hideBlockList); prepPage(); } function ready(fn) { if (document.readyState !== 'loading') { fn(); } else { document.addEventListener('DOMContentLoaded', fn); } } ready(pageOnLoad); })();
-
- 论坛点评
- 帖子: 2866
- 注册时间: 2022年 8月 13日 15:10
- 昵称(选填): follett
Re: 【工具】-屏蔽烦你的id插件
经过多次修正,现在基本上可以屏蔽掉你不喜欢的IDs了吧
-
- 论坛精英
- 帖子: 5378
- 注册时间: 2022年 8月 30日 14:41
- 昵称(选填): 轮逼鉴定专家
-
- 职业作家
- 帖子: 591
- 注册时间: 2022年 7月 31日 16:58
- 昵称(选填): 泥橙
Re: 【工具】-屏蔽烦你的id插件
截个图解释一下?sunnycoast 写了: ↑2023年 7月 29日 19:41 非常感谢, 轮逼都屏蔽掉了。 我是说轮逼的内容确实都屏蔽了, 但是ID还会显示。 不过已经很厉害了, 不需要看那些乱七八糟的内容了, 谢谢!
雅利安正牌婆罗门大厨
-
- 论坛点评
- 帖子: 2866
- 注册时间: 2022年 8月 13日 15:10
- 昵称(选填): follett
Re: 【工具】-屏蔽烦你的id插件
这个论坛的站长,可能就是轮子,至少不是好人。从很多老逼将担任各个版块的版主,可以看出站长的立场。站长肯定披着各种马甲隐藏在论坛上,虽然站长有一个管理员马甲“admin”。sunnycoast 写了: ↑2023年 7月 29日 19:41 非常感谢, 轮逼都屏蔽掉了。 我是说轮逼的内容确实都屏蔽了, 但是ID还会显示。 不过已经很厉害了, 不需要看那些乱七八糟的内容了, 谢谢!
在这个论坛上,就得适应与狼共舞。
-
- 论坛精英
- 帖子: 5378
- 注册时间: 2022年 8月 30日 14:41
- 昵称(选填): 轮逼鉴定专家
-
- 论坛精英
- 帖子: 5378
- 注册时间: 2022年 8月 30日 14:41
- 昵称(选填): 轮逼鉴定专家
Re: 【工具】-屏蔽烦你的id插件
好 我下次截图 谢谢
-
- 知名作家
- 帖子: 1090
- 注册时间: 2023年 7月 19日 22:04
- 昵称(选填): 论坛元老
Re: 【工具】-屏蔽烦你的id插件
-
- 论坛点评
- 帖子: 2516
- 注册时间: 2022年 8月 10日 18:41
- 昵称(选填): Contrarian
Re: 【工具】-屏蔽烦你的id插件
这个帖子里面黑名单不好用?跟lz是站长有关?
viewtopic.php?t=256487
viewtopic.php?t=256487
“It ain’t what you don’t know that gets you into trouble. It’s what you know for sure that just ain’t so. “ – Mark Twain
-
- 知名作家
- 帖子: 833
- 注册时间: 2022年 7月 22日 19:21
Re: 【工具】-屏蔽烦你的id插件
我把某人同时放到了插件黑名单和论坛自带的黑名单里。这样反而能在主题区看他的帖子的主题。现在把他从论坛自带的黑名单中移除,只放在插件黑名单中,这样他的贴子就彻底看不见了。这算不算插件的一个Bug?
-
- 论坛精英
- 帖子: 5640
- 注册时间: 2022年 8月 21日 14:20
Re: 【工具】-屏蔽烦你的id插件
参考op "如何汇报问题"mrchabuduo 写了: ↑2023年 12月 14日 19:37 我把某人同时放到了插件黑名单和论坛自带的黑名单里。这样反而能在主题区看他的帖子的主题。现在把他从论坛自带的黑名单中移除,只放在插件黑名单中,这样他的贴子就彻底看不见了。这算不算插件的一个Bug?
1. 确保所有的code全部copy & paste进了油猴
2. 你是用的什么浏览器
3. 你用的什么主题(控制面板->偏好设置->我的论坛风格)
4. 最好有浏览器截图,可以把书签地址栏隐藏,只需要在某个主题下的截图
Re: 【工具】-屏蔽烦你的id插件
TemperMonkey好像不work了。要交钱?
@huangchong
@huangchong
-
- 论坛元老
- 帖子: 27704
- 注册时间: 2022年 7月 22日 01:22
- 昵称(选填): 净坛使者