blacklist habr

Clear the main page of habr.com from blacklisted authors

  1. // ==UserScript==
  2. // @name blacklist habr
  3. // @author Nemo (S1egfr1ed)
  4. // @namespace S1egfr1ed
  5. // @version 1.1
  6. // @description Clear the main page of habr.com from blacklisted authors
  7. // @match https://habr.com/*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
  9. // @icon http://habr.com/favicon.ico
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. var blacklist=[];
  15. // populate blacklist with you authors
  16. blacklist.push('author');
  17. const articles = document.querySelectorAll('article');
  18. for(const article of articles){
  19. var author = article.getElementsByClassName('tm-user-info__userpic')[0];
  20. var name = author.attributes.getNamedItem('title').value;
  21. if(blacklist.includes(name)){
  22. article.remove();
  23. }
  24. }