Since Elon Musk became Twitter’s CEO, he’s been pushing through a lot of changes to the social network. But perhaps…

  • Big P@feddit.uk
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Someone please make a lemmy client with a word filtering option so I can stop hearing about elmo

    • crowsby@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I can do you one better with a Tampermonkey script that will replace every reference to his name on every webpage to either “the biggest twat on the planet” or “this dipshit”, depending on which works better syntactically.

      // ==UserScript==
      // @name         Text Replace
      // @version      0.1
      // @description  Text Replace
      // @author       SiameseDream
      // @include     *
      // @grant        none
      // @namespace beepboop
      // ==/UserScript==
      
      (function() {
          'use strict';
      
      var replaceArry = [
          [/ Elon Musk/gi,' the biggest twat on the planet'],
          [/Elon Musk/gi,'The biggest twat on the planet'],
          [/ Mr. Musk/gi,' this dipshit'],
          [/ Musk/gi,' this dipshit'],
          [/Mr. Musk/gi,'This dipshit'],
          [/Musk/gi,'This dipshit'],
          // etc.
      ];
      var numTerms    = replaceArry.length;
      var txtWalker   = document.createTreeWalker (
          document.body,
          NodeFilter.SHOW_TEXT,
          {   acceptNode: function (node) {
                  //-- Skip whitespace-only nodes
                  if (node.nodeValue.trim() )
                      return NodeFilter.FILTER_ACCEPT;
      
                  return NodeFilter.FILTER_SKIP;
              }
          },
          false
      );
      var txtNode     = null;
      
      while (txtNode  = txtWalker.nextNode () ) {
          var oldTxt  = txtNode.nodeValue;
      
          for (var J  = 0;  J < numTerms;  J++) {
              oldTxt  = oldTxt.replace (replaceArry[J][0], replaceArry[J][1]);
          }
          txtNode.nodeValue = oldTxt;
      }
      })();
      
      

      In practice it looks like this

        • Madbrad200@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          1 year ago

          There’s plenty of communities on Lemmy that don’t discuss Elon at all. Curate your own homefeed

          • Zima@kbin.social
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            1 year ago

            are there any communities that discuss technology advancements ? I can’t find any sub for technology enthusiasts.

            edit: ah gotcha you’re just telling him to go away while trying to sound reasonable.