Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Ewadication
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description
- // @author The Ewadicatow
- // @match https://www.facebook.com/*
- // @grant none
- // ==/UserScript==
- const THRESHOLD = 5
- function myFunction() {
- 'use strict';
- let feed = document.querySelectorAll("._4-u2");
- feed.forEach( post => {
- let userContent = post.querySelector(".userContent:not([style='display:none'])")
- if (userContent) {
- let offenders = userContent.textContent.match(/(uwu|owo)/gi);
- if (offenders) {
- console.log(offenders.length)
- }
- if ( offenders && offenders.length > THRESHOLD ) {
- post.style.display = "none"
- console.log("post hidden\n")
- console.log(userContent)
- }
- }
- })
- }
- myFunction()
- setTimeout(myFunction, 1000);
- (function () {
- window.addEventListener('scroll', () => {
- myFunction()
- setTimeout(myFunction, 1000);
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement