hide market dashboard posts

hides sven's market dashboard tweets

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==

// @name        hide market dashboard posts
// @namespace   twitter_kboudy
// @description hides sven's market dashboard tweets
// @include     https://twitter.com/*
// @include     https://twitter.com
// @version     3.0
// @run-at      document-start
// @grant       none
// ==/UserScript==

function hideMarketDashboardTweets(){
    const posts = document.getElementsByTagName("article");
    if (posts)
    {
        for (const p of posts)
        {
            const text = p.textContent;
            if (text)
            {
                if ((text.includes("Sven Henrich") && text.includes("Market Dashboard")) ||
                    (text.includes("Sven Henrich") && text.includes("Market Video")))
                {
                    let el = p;
                    while (el.className)
                    {
                        el = el.parentElement;
                    }

                    el.style.display="none";
                }
            }
        }
    }
}

hideMarketDashboardTweets();
setInterval(function(){
    hideMarketDashboardTweets();
},1000);