twitter no media

text-only twitter feed

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         twitter no media
// @namespace    https://greasyfork.org/en/scripts/506662-posts
// @version      1.1
// @description  text-only twitter feed
// @license      MIT
// @author       You
// @match        https://x.com/home
// @match        https://x.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=x.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let comb = function() {
        let timeline = document.querySelector('[aria-label="Home timeline"]');

        if(timeline == null) {
            return true;
        }

        Object.entries(timeline.querySelectorAll("article")).reduce(function(res, item) {

            let article_location = item[1].getBoundingClientRect();

            if(article_location > 1000 && article_location.y * 2 < window.scrollY) {
                item[1].remove();
            }

            let img = item[1].querySelector('[data-testid="tweetPhoto"]') || item[1].querySelector('[data-testid="card.wrapper"]');
            if(img != null) {
                img.remove();
            }

            let videoPlayer = item[1].querySelector('[data-testid="videoPlayer"]');
            if(videoPlayer != null) {
                videoPlayer.remove();
            }

            return true;

        }, true);

        return true;
    };

    setInterval(comb, 500);


})();