twitter no media

text-only twitter feed

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


})();