Skip to content

Instantly share code, notes, and snippets.

@defufna
Created June 25, 2018 10:39
Show Gist options
  • Save defufna/d96710915dd1f769e2c892657a72ba6e to your computer and use it in GitHub Desktop.
Save defufna/d96710915dd1f769e2c892657a72ba6e to your computer and use it in GitHub Desktop.
greasemonkey script for better blic.rs
// ==UserScript==
// @name Better Blic!
// @version 1
// @grant none
// @include https://*.blic.rs/*
// @include https://blic.rs/*
// ==/UserScript==
blacklist = ["kij.?", "kijin", "kijom", "anabel.?", "lun.?", "lunin"]
re = new RegExp("\\b(" + blacklist.join("|") + ")\\b", "i");
function removeNodesMatching(nodeList){
for (i = 0; i < nodeList.length; i++){
node = nodeList[i];
if (node.textContent.match(re)){
node.parentElement.removeChild(node)
}
}
}
crapNews = document.querySelectorAll("section.news-list.puls-content");
for(var i = 0; i < crapNews.length; i++){
crapNews[i].parentElement.removeChild(crapNews[i]);
}
crapNews = document.querySelectorAll("li");
removeNodesMatching(crapNews);
crapNews = document.querySelectorAll("article");
removeNodesMatching(crapNews);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment