StandardUnMusk

Avoid everything Musk on derStandard

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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

(function() {
    'use strict';
    var articles, art;
    // var replacementPic = 'https://place-puppy.com/270x151';
    var replacementPic = 'https://placekitten.com/270/151';
    var replacementCredits = 'placekitten.com';
    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',
        'Unterstützen Sie gute Haustierbilder',
        'Es gibt keinen guten Feed für Traktorenbilder',
        'Können diese Augen lügen?',
        '(apa)',
        'Foto: ' + replacementCredits + ', vermutlich nicht Cremer',
        'Foto: Vielleicht doch Cremer?',
        'Wir kennen den Artikel nicht. Claudia kennt ihn auch nicht.'
    ];
    if (!(articles = document.getElementsByTagName('article'))) return;
    for (const art of articles) {
        if(art.innerText.match(/(Elon)? Musk[\.\s,\:-]/) || art.innerHTML.match(/[\-\/]musks?[\-\'\"]/)) {
            var loopRand = Math.random();
            art.innerHTML =
                '<div><figure><picture>' +
                    '<img src="' + replacementPic + '?' + loopRand + '" title="" alt="' + replacementCredits + '"/>' +
                '</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>';
        }
    }
})();