Removes OnlyFans annoyances

Script to help de-clutter your Onlyfans feed.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Removes OnlyFans annoyances
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Script to help de-clutter your Onlyfans feed.
// @author       Owen3H
// @match        https://onlyfans.com*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @license      MIT
// ==/UserScript==

const postsSelector = ".vue-recycle-scroller__item-view"
const postHeaderSelector = ".b-post__header m-w50"

function clearOfficialPosts() {
    var posts = document.querySelectorAll(postsSelector);
    console.log(posts);

    var postLen = posts.length;
    var counter = 0;

    for (var i = 0; i < postLen; i++) {
        var post = posts[i];
        if (post.innerText.toLowerCase().includes('@onlyfans')) {
            post.remove();
            counter++;
        }
    }

    console.log('OnlyFans Annoyances: Removed ' + counter + ' posts from the @Onlyfans account')
}

function removeRecommended() {
    var recommended = document.querySelector(".b-recommended");
    var p = null;

    if (recommended) {
        p = recommended.parentNode;
    }

    if (!p) {
        console.log('OnlyFans Annoyances: Error removing suggested creators, could not find element.');
        return false;
    }

    p.removeChild(recommended);
    console.log('OnlyFans Annoyances: Removed suggested creators!');
    return true;
}

function delay(ms) {
    setTimeout(function () {}, ms);
}

(function() {
    delay(1300);

    setInterval(clearOfficialPosts, 250);
    setInterval(removeRecommended, 600);
})();