Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save homocomputeris/dee2ed211fb2915fdc75f8f03db92306 to your computer and use it in GitHub Desktop.
Save homocomputeris/dee2ed211fb2915fdc75f8f03db92306 to your computer and use it in GitHub Desktop.
Habr editor blocker
// ==UserScript==
// @name Habr editor blocker
// @description Hides articles that were posted by certain authors
// @match https://habr.com/*
// @version 1
// @grant none
// ==/UserScript==
// @namespace http://tampermonkey.net/
// https://habr.com/post/391233/
var authors = [
'alizar',
'marks',
'ivansychev',
'ragequit',
'SLY_G',
];
var posts = document.querySelectorAll('.post');
for (var idx = 0; idx < posts.length; ++idx) {
var post = posts[idx];
for (var i = 0; i < authors.length; ++i) {
var selector = '.post__user-info[href$="/' + authors[i] + '/"]';
var blockedAuthor = post.querySelector(selector);
if (blockedAuthor) {
post.style.display = 'none';
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment