Kathimerini Content Filter

Φιλτράρισμα περιεχομένου στο Kathimerini.gr

  1. // ==UserScript==
  2. // @name Kathimerini Content Filter
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Φιλτράρισμα περιεχομένου στο Kathimerini.gr
  6. // @match *://*.kathimerini.gr/*
  7. // @grant none
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Προσθέστε τις ετικέτες που θέλετε να κρύψετε εδώ
  15. const hideKeywords = [
  16. 'ΑΘΛΗΤΙΣΜΟΣ',
  17. 'ΓΑΣΤΡΟΝΟΜΟΣ',
  18. 'athletic',
  19. 'gastronomos'
  20. ];
  21.  
  22. function hideContent() {
  23. // Κρύψιμο με βάση τις κατηγορίες και τις διευθύνσεις URL
  24. const style = document.createElement('style');
  25. style.textContent = hideKeywords.map(keyword => `
  26. [class*="${keyword}"],
  27. [id*="${keyword}"],
  28. a[href*="${keyword.toLowerCase()}"] {
  29. display: none !important;
  30. }
  31. `).join('\n');
  32. document.head.appendChild(style);
  33.  
  34. // Κρύψιμο άρθρων με βάση το περιεχόμενο
  35. const articles = document.querySelectorAll('article, .article, .story, .entry');
  36. articles.forEach(article => {
  37. const text = article.textContent.toUpperCase();
  38. if (hideKeywords.some(keyword => text.includes(keyword.toUpperCase()))) {
  39. article.style.display = 'none';
  40. }
  41. });
  42. }
  43.  
  44. // Εκτέλεση στη φόρτωση της σελίδας
  45. hideContent();
  46.  
  47. // Εκτέλεση σε δυναμικές αλλαγές
  48. new MutationObserver(hideContent).observe(document.body, {
  49. childList: true,
  50. subtree: true
  51. });
  52. })();