SHARE
TWEET

Untitled

a guest Sep 5th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        3dtoday post blocker
  3. // @description Hides articles that were posted by certain authors
  4. // @include     https://3dtoday.ru/*
  5. // @version     1
  6. // @grant       none
  7. // ==/UserScript==
  8.  
  9. var authors = ['ski','vasyna'];
  10.  
  11. var posts = document.querySelectorAll('.post_list_item');
  12. for (var idx = 0; idx < posts.length; ++idx) {
  13.   var post = posts[idx];
  14.   for (var i = 0; i < authors.length; ++i) {
  15.     var selector = '.post_list_item_autor a[href="https://3dtoday.ru/blogs/' + authors[i];
  16.     var blockedAuthor = post.querySelector(selector);
  17.     if (blockedAuthor) {
  18.       post.style.display = 'none';
  19.       break;
  20.     }
  21.   }
  22. }
  23.  
  24. var comments = document.querySelectorAll('.blog_comment');
  25. for (var idx = 0; idx < comments.length; ++idx) {
  26.   var comment = comments[idx];
  27.   for (var i = 0; i < authors.length; ++i) {
  28.     var selector = '.autor a[href="https://3dtoday.ru/blogs/' + authors[i];
  29.     var blockedAuthor = comment.querySelector(selector);
  30.     if (blockedAuthor) {
  31.       comment.style.display = 'none';
  32.       break;
  33.     }
  34.   }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top