Removes OnlyFans annoyances

Script to help de-clutter your Onlyfans feed.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);
})();