Greasy Fork

StandardUnMusk

Avoid everything Musk on derStandard.at

目前为 2022-06-06 提交的版本。查看 最新版本

// ==UserScript==
// @name         StandardUnMusk
// @namespace    https://derstandard.at/
// @version      0.4.6
// @description  Avoid everything Musk on derStandard.at
// @author       dersansard
// @match        *://*.derstandard.at/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    var articles, art;
    var teasers = [
        'Keine Panik',
        'Nicht aufregen',
        'Intermission',
        'Pause zur Mitte der Webseite',
        'Wirklich!',
        'Es ist nichts passiert'
    ];
    var subtitles = [
        'Hier gibt es nichts zu lesen',
        'Bitte scrollen Sie weiter',
        'Genießen Sie diese Auszeit mit einem Welpenbild',
        'Unterstützen Sie gute Welpenbilder',
        'Es gibt keinen guten Feed für Traktorenbilder',
        'Können diese Augen lügen?',
        '(apa) Foto: place-puppy.com, vermutlich nicht Cremer'
    ];
    articles = document.getElementsByTagName('article');
    if (!articles) { return; }
    for (const art of articles) {
        if(art.innerText.match(/elon musk/i) || art.innerHTML.match(/[\-\/]musks?\-/)) {
            var loopRand = Math.random();
            art.innerHTML =
                '<div><figure><picture>' +
                    '<img src=" https://place-puppy.com/270x151?' + loopRand + '" title="" alt="place-puppy.com"/>' +
                '</picture></figure>' +
                '<header>' +
                    '<div class="teaser-postingcount">' + Math.floor(loopRand*9000) + ' <span>Postings</span></div>' +
                    '<p class="teaser-kicker">Alles wird gut</p>' +
                    '<h1 class="teaser-title">' + teasers[Math.floor(loopRand*teasers.length)] + '</h1>' +
                    '<p class="teaser-subtitle">'+ subtitles[Math.floor(Math.random()*subtitles.length)] + '</p>'
                '</header></div>';
        }
    }
})();