您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
5个功能:只看楼主,展开评论,隐藏掉帖子中的红包、打赏、废话和只有英文数字的楼层,去广告,显示头像
当前为
// ==UserScript== // @name 天涯小助手 // @namespace http://tampermonkey.net/ // @version 0.16 // @description 5个功能:只看楼主,展开评论,隐藏掉帖子中的红包、打赏、废话和只有英文数字的楼层,去广告,显示头像 // @require https://code.jquery.com/jquery-2.1.4.min.js // @author 高压锅 // @include http*://bbs.tianya.cn/post-* // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function () { $('script[src="https://d31qbv1cthcecs.cloudfront.net/atrk.js"]').remove(); var gyg_filter_garbage = GM_getValue('filter_garbage', '1') == '1'; var gyg_expand_comments = GM_getValue('expand_comments', '1') == '1'; var gyg_see_only_host = GM_getValue('see_only_host', '0') == '1'; var gyg_disp_avatar = GM_getValue('disp_avatar', '0') == '1'; var lzid = $('.js-bbs-act').attr('_host'); $('head').append('<style type="text/css">#js-bc-shang,#js-tybc-3-2,#bc_dsEbookMon,.tybc-wp,.ds_vip_seats,#ty_msg_mod,#shang-move,#ds-quick-menu,.open-vip-tips,.vip-btn,#bbs_login_div,.bbs-login-tip{display:none !important;}</style>'); $('head').append('<style type="text/css">.atl-head .atl-info{height: 42px !important;} .logo_inline{height:40px;width:40px;}</style>'); $('div[id^="js-tybc-"],.vip-read,.see-host,div.ads-loc-holder,div.post-area-adv,.host-stocks,#niuren_ifm,#host_per_info').remove(); $('.read-menu').first().append('<input type="checkbox" id="disp-avatar"' + (gyg_disp_avatar ? ' checked="checked"' : '') + ' /><label for="disp-avatar">头像</label><input type="checkbox" id="filter-garbage"' + (gyg_filter_garbage ? ' checked="checked"' : '') + ' /><label for="filter-garbage">脱水</label><input type="checkbox" id="expand-comments"' + (gyg_expand_comments ? ' checked="checked"' : '') + ' /><label for="expand-comments">展开评论</label><input type="checkbox" id="see-only-host"' + (gyg_see_only_host ? ' checked="checked"' : '') + ' /><label for="see-only-host">只看楼主</label>'); var ks = [ '<br>', 'mark', '记号', '马克', '兰州烧饼', '(早|晚)上好', '(上|中|下)午好', '(早|晚)安', '(好|顶)(帖|贴)', '催更', '顶一下', '帮顶', '点赞', '赞同', '安全点赞区', '翻页', '顶(起|贴|帖)', '(支持|学习)(一下|楼主)?', '快更', '等更', '坐等更', '路过', '楼主', '加油', '继续', '(节日|新年|春|元旦|国庆|端午|中秋|仲秋|元宵|情人|父亲|母亲|七夕|重阳|除夕|龙舟|清明|腊八|小年|周末|儿童|六一|五四|五一|劳动|青年|妇女|三八)节?(快乐|安康|愉快)', '火(钳|前)|(留|刘)(名|明|翔)', '打卡', '谢谢', '感(谢|恩)', '看看', '试试', '呵呵', '哈哈', '恭喜', '前排', '占座', '沙发', '板凳', '占个?座位?', '欢迎', '先顶再看', '拭目以待', '师母已呆', '(收藏|关注|厉害|辛苦|学习)了?', '酱油', '牛(逼|批|b)', '精辟', '已阅', '膜拜', '(有点|几个|什么)意思' ]; var re = new RegExp(ks.join('|'), 'ig'); $('#filter-garbage').click(function () { gyg_filter_garbage = !gyg_filter_garbage; resort(); GM_setValue('filter_garbage', gyg_filter_garbage ? '1' : '0'); $(this).blur(); }); $('#see-only-host').click(function () { gyg_see_only_host = !gyg_see_only_host; resort(); GM_setValue('see_only_host', gyg_see_only_host ? '1' : '0'); $(this).blur(); }); $('#disp-avatar').click(function () { gyg_disp_avatar = !gyg_disp_avatar; resort(); GM_setValue('disp_avatar', gyg_disp_avatar ? '1' : '0'); $(this).blur(); }); function resort() { var aHidden = new Array(); if (gyg_filter_garbage) { aHidden.push('[garbage="1"]'); } if (gyg_see_only_host) { aHidden.push('[ishost="0"]'); } $('div.atl-item').each(function () { var jThis = $(this); jThis.is(aHidden.join(',')) ? jThis.hide() : jThis.show(); }); gyg_disp_avatar ? $('.logo_inline').show() : $('.logo_inline').hide(); } $('#expand-comments').click(function () { $(this).blur(); gyg_expand_comments = !gyg_expand_comments; $('a.ir-showreply[yh_cmt_btn="1"]').each(function () { $(this)[0].click(); }); GM_setValue('expand_comments', gyg_expand_comments ? '1' : '0'); }); $('body').on('DOMSubtreeModified', '.ir-list ul', function (e) { var evt = e || window.event; var t = $(evt.target); var _hostid = t.parents('div.atl-item').attr('_hostid'); if (t.html() != '') { t.find('li').each(function () { var cid = $(this).attr('_userid'); $(this).find('p a').first().prepend('<img class="logo_inline" _hostid="'+cid+'"' + (gyg_disp_avatar ? '' : ' style="display: none"') + ' src="http://tx.tianyaui.com/logo/small/' + $(this).attr('_userid') + '" />' + (cid != lzid && _hostid == cid ? '(层主) ' : '')); }); } }); $('div.atl-item').each(function () { var jThis = $(this); var _hostid = jThis.attr('_hostid'); jThis.attr('ishost', _hostid == lzid ? '1' : '0'); jThis.find('div.atl-info span').first().prepend('<img class="logo_inline" _hostid="'+_hostid+'" style="display: none" src="http://tx.tianyaui.com/logo/small/' + _hostid + '" />'); if (jThis.find('div.red-pkt-v2').length > 0 || jThis.find('a.dashang-btn').length > 0) { jThis.attr('garbage', '1'); return; } jThis.find('.ir-list li').each(function () { var cid = $(this).attr('_userid'); $(this).find('p a').first().prepend('<img class="logo_inline" _hostid="'+cid+'" style="display: none" src="http://tx.tianyaui.com/logo/small/' + $(this).attr('_userid') + '" />' + (cid != lzid && _hostid == cid ? '(层主) ' : '')); }); var jReply = jThis.find('a.ir-showreply'); if (jReply.length > 0) { jThis.attr('garbage', '0'); jReply.attr('yh_cmt_btn', '1'); if (gyg_expand_comments) { jReply[0].click(); } return; } var dry = $.trim(jThis.find('div.bbs-content').first().html().replace(re, '')).replace(/([·…!?!?\n。、.~~,,顶 ])\1+/g, '$1').replace(/[·…!?!?\n。、.~~,,顶 ]+$/, '').replace(/^[·…!?!?\n。、.~~,,顶 ]+/, ''); if (dry.length < 4 || /^[a-zA-Z0-9]+$/.test(dry)) { jThis.attr('garbage', '1'); } }); resort(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址