X.com (Twitter) - Auto Show More Replies

X.com (Twitter) Auto Show More Replies, Included Probable Spam. 推特自动显示所有回复,包括可能的垃圾信息。

// ==UserScript==
// @name         X.com (Twitter) - Auto Show More Replies
// @namespace    http://tampermonkey.net/
// @version      2.1
// @description  X.com (Twitter) Auto Show More Replies, Included Probable Spam. 推特自动显示所有回复,包括可能的垃圾信息。
// @author       Martin______X
// @match        https://twitter.com/*
// @include      https://x.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=x.com
// @grant        none
// @license      MIT
// ==/UserScript==

/* */
let $button1 = "css-175oi2r r-1777fci r-1pl7oy7 r-13qz1uu r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l";
/* Sensitive Replies*/
let $button2 = "css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-faml9v r-2dysd3 r-15ysp7h r-4wgw6l r-3pj75a r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l";

const simpleClick = (async (more_replies_button) => {
    more_replies_button.click();
});
const moreRepliesInterval = setInterval(() => {
    try{
        if (document.URL.includes("status")) {
            //Counter
            let i = 0;
            //
            let more_replies_button = document.getElementsByClassName($button1);
            for (i = 0; i < more_replies_button.length; i++) {
                simpleClick(more_replies_button[i]);
            }
            let more_replies_button2 = document.getElementsByClassName($button2);
            for (i = 0; i < more_replies_button2.length; i++) {
                if(!more_replies_button2[i].hasAttribute("href")){
                    simpleClick(more_replies_button2[i]);
                }
            }

        }
    }catch(error){
        //console.error(error)
    }
}, 1);