// ==UserScript== // @name 贴吧助手(屏蔽,排序) beta // @namespace http://tampermonkey.net/ // @version 1.1.1 // @description 1, 屏蔽指定用户的所有发帖 2 ,排序(按回复)),具体看下面仔细描述 // @author You // @match https://tieba.baidu.com/** // @grant GM_setValue // @grant GM_getValue // @run-at document-idle // @downloadURL none // ==/UserScript== //修复翻页后屏蔽无效的bug //修复翻页后x按钮消失 //其他小bug (function() { //需先其他js执行后 执行才可获取到dom setTimeout(function(){ //屏蔽模块 (function(){ //隐藏 指定数组(如 [{"user_id":1370621204},{},{} ]格式 )里的所有用户 的主题 //初始化屏蔽......................... var userIds=GM_getValue("pbUserIds");//获取屏蔽用户数据 console.log("屏蔽用户",userIds); if(!userIds){ userIds=[]; } hideIt(userIds);//开始屏蔽 initXbutton();//x按钮 initDelpinbi();//取消屏蔽按钮 bindPageMenu();//底部翻页按钮按钮绑定事件触发继续屏蔽 //........................初始化屏蔽 function hideIt(array){ var count=0; $("span.tb_icon_author").each(function(){ var spanTb=this; try{ var value2=$(this).data("field").user_id; } catch(e){ return; } array.forEach(function(item,index,array){ var value=item.user_id; if(value==value2){ $(spanTb).closest("li.j_thread_list.clearfix").hide(); count++; } }); }); console.log("屏蔽条数:",count); } //初始化自定义屏蔽按钮 function initXbutton(){ $(".frs-author-name-wrap a").after($("")); $(".xButton").click(function(){ var targetUserid=$(this).closest("span.tb_icon_author").data("field"); userIds.push(targetUserid); GM_setValue("pbUserIds",userIds); hideIt([targetUserid]); }); } // 初始化 定义清除 屏蔽用户按钮 function initDelpinbi(){ $li=$("