search dashboard

shows only posts w specific word(s)

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name search dashboard
// @namespace Violentmonkey Scripts
// @author ghostplantss
// @grant none
// @match *://www.tumblr.com/*
// @description shows only posts w specific word(s)
// @version 1.1
// @require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
// 
// 

var words = ["society"];
(
  function scroll (f) {
  var count = 0;
  window.addEventListener("scroll", ( //every time you scroll
  function fun() //it runs this function!
  {
    $("div.post").each(function() //for each post
    { 
      if(!$(this).hasClass('search'))//if it hasn't been checked already
       {
         count++;
         var boo=true;
         this.className += " search";
          var divs = this.getElementsByTagName('p');
         for(var i = 0; i< divs.length;i++)//it iterates through all paragraphs in the post 
          {
            for(var j = 0; j< words.length;j++)//iterates through the words you want to find
            {
              if(divs[i].innerHTML.indexOf(words[j]) !== -1){boo=false;}//if the word is in the post, you display it
              
             }
          }
         if(boo&&count>1)//make sure word is in post + there's still a post on the dashboard
           {
             $(this).css('display','none');//if the word isn't in the post you hide it 
           }
       }
    });
  }), false);//the end
}

)(window.jQuery);