FurAffinity YCH/Comission submission hide and remove

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

目前為 2018-12-12 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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.1
// @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"];	                        //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
})();