百度贴吧添加我的回复按钮

消息按钮列表显示我的回复

当前为 2022-10-20 提交的版本,查看 最新版本

// ==UserScript==
// @name         百度贴吧添加我的回复按钮
// @namespace    http://tampermonkey.net/
// @version      0.1.8
// @description  消息按钮列表显示我的回复
// @author       AN drew
// @match        https://tieba.baidu.com/*
// @license      MIT
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';


    let blacklist = new Set(['tb.1.799c5565.B5RZU87zci5PWiKZuJbB9g',
                             'tb.1.719d1be6.PNFJXEpQCIwE5Y8sxkAh7Q',
                             'tb.1.36af074f.NRi5aqOvEhihsprdx6e1TQ',
                             'tb.1.7924280c.CKQHLFyXmmqrJdbFRluI0Q',
                             'tb.1.640e803c.lHh99VVfkdYCUebspPdYsA',
                             'tb.1.bb33716b.nyYacQlDrbz9u9924XODqQ',
                             'tb.1.4cf0093a.Sw1dSPeXG355_ZhcTg0a8w',
                             'tb.1.d0bd3398.gQv1O3wf86hCI0DmDvEEHA',
                             'tb.1.2ea66754.0t9tFTrX-DRGl0vnuHKLxA'
                            ]);


    setInterval(function(){
        $('.j_thread_list').each(function(){
            let author=$.parseJSON($(this).attr('data-field')).author_portrait;
            let id=$.parseJSON($(this).find('.tb_icon_author').attr('data-field')).user_id;
            if(blacklist.has(author) || blacklist.has(id))
            {
                //console.log($.parseJSON($(this).attr('data-field')))
                $(this).attr('style','background:red');
                $(this).addClass('hide');
            }
        })
    },1000);

    setTimeout(function(){
        $('#com_userbar > ul > li.u_news > div.u_ddl > div > div.u_ddl_con_top > div > ul.sys_notify.j_sys_notify.j_category_list > li:nth-child(2)').after('<li class="category_item category_item_empty">        <a class="j_cleardata" href="http://tieba.baidu.com/i/i/my_reply" target="_blank" data-type="reply" se_prerender_url="complete">我的回复            </a>        </li>');
        $('#u_notify_item > li:nth-child(2)').after('<li class="category_item category_item_empty">        <a class="j_cleardata" href="http://tieba.baidu.com/i/i/my_reply" target="_blank" data-type="reply" se_prerender_url="complete">我的回复            </a>        </li>');
    },5000);

    if(window.location.href.indexOf('tieba.baidu.com/p/') > -1)
    {
        let timer = setInterval(function(){
            let fa_date
            $('.p_postlist .l_post:first-child .tail-info').each(function(){
                if($(this).text().indexOf('-')>-1 && $(this).text().indexOf(':')>-1)
                {
                    fa_date=new Date($(this).text());
                }
            })

            let now_date=new Date();
            if(now_date-fa_date>7*24*60*60*1000)
            {
                $('#j_core_title_wrap, .core_title_theme_bright,.l_post_bright, .l_post_bright .d_post_content_main, .l_post_bright .d_post_content_main .p_content').css('background','red');
                clearInterval(timer);
            }
        },1000);
    }
    $('.b_right_up nobr:nth-child(2) .b_reply').each(function(){
        if(!$(this).hasClass('pic') && $(this).text()=='回复')
        {
            $(this).text('【图片回复】');
            $(this).addClass('pic');
        }
    })

    GM_addStyle(`body {overflow-x: auto;}
    .af_container{overflow: auto;}
    .tbui_aside_float_bar{display:none!important}
    .j_thread_list.hide{display:none!important}`);

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址