Skip to content

Instantly share code, notes, and snippets.

@dumptyd
Last active December 27, 2015 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dumptyd/5a13fcabdb9d862946c8 to your computer and use it in GitHub Desktop.
Save dumptyd/5a13fcabdb9d862946c8 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YouTube Filter
// @namespace sadEmoji
// @author sadEmoji
// @description Filters YouTube Videos (only works on firefox)
// @include https://www.youtube.com/results?search_query=*
// @version 1.2.3
// @grant none
// @require https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
vscript=document.createElement('script');
vscript.src='https://code.jquery.com/jquery-2.1.4.min.js';
vscript.type='text/javascript';
vscript.id='fuck';
document.getElementsByTagName('head')[0].appendChild(vscript);
setInterval(function(){filter()},1000);
function filter()
{
//Enter the blocked words here
blockedWords=["MrSuicideSheep","Justin Bieber"];
totalResults=$(".yt-lockup-content").length;
$(".yt-lockup-content").each(function()
{
for(i=0;i<blockedWords.length;++i)
{
//alert($(this).text())
if($(this).text().toUpperCase().contains(blockedWords[i].toUpperCase()))
{
//alert(a);
$(this).parent().hide();
//alert("yes");
return;
}
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment