De-spamify FurAffinity Search

Removes 99% of YCH/Reminder/Adoptables/etc. spam from FurAffinity searches by appending a carefully crafted negation string to the end of your search.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         De-spamify FurAffinity Search
// @author       Vuccala
// @namespace    https://greasyfork.org/en/users/1148791-vuccala
// @version      0.63
// @description  Removes 99% of YCH/Reminder/Adoptables/etc. spam from FurAffinity searches by appending a carefully crafted negation string to the end of your search.
// @match        *://*.furaffinity.net/*
// @icon         https://archive.org/download/despamify-fa-icon/nogreed.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

// This is the blacklist string that gets appended to your search. You can edit it to customize it.
    const customTag = "!@title "+
    "ych|ychs|reminder|rem|remind|adopt|adopts|adoptable|adoptables|slots|auction|raffle|stream|streaming|closed|sale|"+
    "commissions|comissions|(commission open)|(comms open)|(commission sheet)|(commission rates)|(commission prices)|(commission price)|(commission info)|(commission sale)|"+
    "(patreon exclusive)|(patreon preview)|(patreon teaser)|gumroad|"+
    "(price list)|(price sheet)|(price fix)|(price open)|(price offer)|(price fixed)|(price drop)";

//Note: the word "commissions" can be outright blocked since it's only ever used in spam,
//but the singular "commission" often isn't, so I blacklist it only when it appears in spammy terms like (commission open) and (commission rates) etc.

    const searchInputs = document.querySelectorAll('input[name="q"]');
    const searchForm = document.querySelectorAll('form[action="/search/"]');

    if (searchInputs.length > 0 && searchForm.length > 0) {
        searchForm.forEach((form, index) => {
            form.addEventListener('submit', function(event) {
                const currentValue = searchInputs[index].value.trim();
                if (currentValue && !currentValue.endsWith(customTag)) {
                    searchInputs[index].value = currentValue + ' ' + customTag;
                }
            });
        });
    }

// This removes the div that lists all the search terms you just searched for, because it's screen-length after all the negating search terms have been injected.

  const queryStatsDiv = document.getElementById("query-stats");
    if (queryStatsDiv) {
        queryStatsDiv.remove();
    }

})();