FurAffinity YCH/Comission submission hide and remove

Clear out those fucking useless YCH/AUCTION/REMINDER/ETC submissions

Stan na 23-01-2019. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         FurAffinity YCH/Comission submission hide and remove
// @namespace    https://greasyfork.org/en/scripts/375466-furaffinity-ych-comission-submission-hide-and-remove
// @version      1.3
// @description  Clear out those fucking useless YCH/AUCTION/REMINDER/ETC submissions
// @author       SomeAnnoyedFAUser
// @match        http://www.furaffinity.net/msg/submissions/*
// @require      http://code.jquery.com/jquery-latest.js
// ==/UserScript==

(function() {
    'use strict';
    var jQuery = window.jQuery;											//Need for Tampermonkey or it raises warnings...

    var keywordsToRemove = ["ych","auction","reminder","stream"];	                        //The words being searched for..
    var noOfKeywordsToCheck = keywordsToRemove.length;					//The number of keywords, this is used to loop over so we check every single one...
    var keywordIterator = 0;											//We start our checks at the zeroeth keyword
    var blacklistedWord = "";											//Holds keyword being searched for

    var submissionList = jQuery( "figcaption" );						//A list of all the submission items on the page, this contains the text only, not the images...
    var noOfSubmissionsToCheck = submissionList.length;					//The number of submissions, this is used to loop over so we check every single one...
    var submissionIterator = 0;											//We start our checks at the zeroeth submissions
    var currText = "";													//Holds text of submission being checked

    for (submissionIterator; submissionIterator < noOfSubmissionsToCheck; submissionIterator++)				//Loops over all of the submissions
    {
        currText = submissionList.eq(submissionIterator).text();											//Text of current submission
        console.log("Currently checking "+currText);														//Prints out currently being checked submission
        keywordIterator = 0;																				//Resets it, so the next submission is checked against the keywords

        for (keywordIterator; keywordIterator < noOfKeywordsToCheck; keywordIterator++)						//Loops over all of the submissions
        {
            blacklistedWord = keywordsToRemove[keywordIterator];											//Gets word to check based on loop iteration
            console.log("Checking for blacklisted word "+blacklistedWord);									//Prints it to the console for clarity
            if (currText.toLowerCase().includes(blacklistedWord))											//If the current submission has a blacklisted word
            {
                console.log("The submission "+currText+" contains the blacklisted word "+blacklistedWord);	//Indicate that in the console
				submissionList.eq(submissionIterator).parent().find(":checkbox").prop('checked', true);		//Ticks the checkbox so when you click "Remove checked" it is removed
				submissionList.eq(submissionIterator).parent().hide()										//Hides it from the page
                console.log("It has been ticked, and hidden from the page. Happy browsing!");				//Indicate that it has been DESTROYED in the console
            }
        }//End of keyword loop
    }//End of submission loop
})();