3dtoday hide script
// ==UserScript==
// @name 3dtoday post blocker
// @description Hides articles that were posted by certain authors
// @include http://3dtoday.ru/*
// @version 1
// @grant none
// ==/UserScript==
var authors = [
'ski'
];
var posts = document.querySelectorAll('.post_list_item');
for (var idx = 0; idx < posts.length; ++idx) {
var post = posts[idx];
for (var i = 0; i < authors.length; ++i) {
var selector = '.post_list_item_autor a[href="/blogs/' + authors[i] + '/"]';
var blockedAuthor = post.querySelector(selector);
if (blockedAuthor) {
post.style.display = 'none';
break;
}
}
}
var comments = document.querySelectorAll('.blog_comment');
for (var idx = 0; idx < posts.length; ++idx) {
var comment = comments[idx];
for (var i = 0; i < authors.length; ++i) {
var selector = '.autor a[href="/blogs/' + authors[i] + '/"]';
var blockedAuthor = comment.querySelector(selector);
if (blockedAuthor) {
comment.style.display = 'none';
break;
}
}
}