Created
June 25, 2018 10:39
-
-
Save defufna/d96710915dd1f769e2c892657a72ba6e to your computer and use it in GitHub Desktop.
greasemonkey script for better blic.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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