hide market dashboard posts

hides sven's market dashboard tweets

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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);