QuitaMierda

Evita que ciertos blogs "tecnológicos" te spoileen tus series favoritas y hablen de temas chorra

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         QuitaMierda
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Evita que ciertos blogs "tecnológicos" te spoileen tus series favoritas y hablen de temas chorra
// @author       DonNadie
// @require 	 http://code.jquery.com/jquery-latest.js
// @match        http://*.xataka.com
// @match        http://xataka.com
// @match        http://genbeta.com
// @match        http://*.genbeta.com
// @match        http://gizmodo.com
// @match        http://*.gizmodo.com
// @match        http://kotaku.com
// @match        http://*.kotaku.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var forbiddenWords = [
        "juego de tronos",
        "game of thrones",
        "Pokémon Go"
    ];

    var isForbbiden = function (title)
    {
        var k;

        for (k in forbiddenWords)
        {
            if (title.indexOf(forbiddenWords[k].toLowerCase()) !== -1) {
                return true;
            }
        }
        return false;
    };

    $(document).ready(function() {
        switch (location.host) {
            case "es.gizmodo.com":
            case "kotaku.com":
                $('h1.headline').each(function () {
                    var title = $(this).text().toLowerCase();

                    if (isForbbiden(title)) {
                        $(this).parent().parent().parent().remove();
                    }
                });
                break;
            case "www.genbeta.com":
            case "www.xataka.com":
                $('h2.article-home-header').each(function () {
                    var title = $(this).text().toLowerCase();

                    if (isForbbiden(title)) {
                        $(this).parent().remove();
                    }
                });
                break;
        }
    });
})();