Reddit Sellers Filter

Hide posts by onlyfans and other sellers

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Reddit Sellers Filter
// @namespace    http://tampermonkey.net/
// @version      1.01
// @description  Hide posts by onlyfans and other sellers
// @author       nvrmnd
// @match        https://old.reddit.com/*
// @exclude      https://old.reddit.com/user/*
// @icon         https://www.google.com/s2/favicons?domain=reddit.com
// @grant        none
// ==/UserScript==

(function() {
    if (window.top != window.self) {
        //-- Don't run on frames or iframes
        return;
    }
    console.log("🐒🔧💥");
    'use strict';

    setInterval( main, 5000 );
})();

function main() {
    //console.log( "ONLYFAN FILTER TRIGGERING" );
    var $ = window.jQuery;
    var jQuery = window.jQuery;

    // Put any sellers you still want to see here, comma-delimited and lower-case
    var exceptionsList = ["some_user_name", "some_other_user"];

    // The RegEx of things to exclude; the first part tries to avoid excluding people saying things like "I don't have an onlyfans!"
    // If you want to add something, just slap it on the end like |(my new phrase)
    var sellerMatches = "(?<!(no )|(don't have )|(don't have an ))(([Oo]nly[Ff]ans)|([Oo]nly.*[Ff]ans)|(ONLYFANS)|(OF)|([Tt][Oo][Pp] [\d.]+%)|(linktr.ee)|(allmylinks)|([Hh]utt.co)|($[/d.]+)|(on sale)|(current sale)|(custom content))";
    var sellerRegEx = new RegExp( sellerMatches , "m" );

    $( ".thing" ).each(function() {
        var rThing = $( this );
        if( rThing.attr("data-sellerFilter") == "scanned" ) { return; } // Don't run on users we already filtered

        var rUser = rThing.attr( "data-author" );
        if( rUser !== undefined ) {
            // Mark it so we don't have to scan it again
            rThing.attr('data-sellerFilter', 'scanned');

            // Skip exceptions
            if( exceptionsList.indexOf(rUser.toLowerCase()) > -1 ) {
                console.log( rUser, ": SKIPPING EXCEPTION" );
                return;
            }

            // Use API to get the about page for the user via AJAX
            $.getJSON('https://www.reddit.com/user/'+rUser+'/about/.json', function(jd) {
                // Get their public description
                var rPubDesc = jd.data.subreddit.public_description;
                if( rPubDesc !== "" ) {
                    // Try and find seller keywords in user description and hide those posts
                    //console.log( rUser, rPubDesc );
                    if( rPubDesc.search(sellerRegEx) >= 0 ) {
                        console.log( rUser, ": FILTERED");
                        rThing.css( "display", "none" );
                    }
                }
            });
        }
    });
}