QuitaMierda

Evita que ciertos blogs "tecnológicos" te spoileen tus series favoritas y hablen de temas chorra

  1. // ==UserScript==
  2. // @name QuitaMierda
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Evita que ciertos blogs "tecnológicos" te spoileen tus series favoritas y hablen de temas chorra
  6. // @author DonNadie
  7. // @require http://code.jquery.com/jquery-latest.js
  8. // @match http://*.xataka.com
  9. // @match http://xataka.com
  10. // @match http://genbeta.com
  11. // @match http://*.genbeta.com
  12. // @match http://gizmodo.com
  13. // @match http://*.gizmodo.com
  14. // @match http://kotaku.com
  15. // @match http://*.kotaku.com
  16. // @grant none
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. var forbiddenWords = [
  23. "juego de tronos",
  24. "game of thrones",
  25. "Pokémon Go"
  26. ];
  27.  
  28. var isForbbiden = function (title)
  29. {
  30. var k;
  31.  
  32. for (k in forbiddenWords)
  33. {
  34. if (title.indexOf(forbiddenWords[k].toLowerCase()) !== -1) {
  35. return true;
  36. }
  37. }
  38. return false;
  39. };
  40.  
  41. $(document).ready(function() {
  42. switch (location.host) {
  43. case "es.gizmodo.com":
  44. case "kotaku.com":
  45. $('h1.headline').each(function () {
  46. var title = $(this).text().toLowerCase();
  47.  
  48. if (isForbbiden(title)) {
  49. $(this).parent().parent().parent().remove();
  50. }
  51. });
  52. break;
  53. case "www.genbeta.com":
  54. case "www.xataka.com":
  55. $('h2.article-home-header').each(function () {
  56. var title = $(this).text().toLowerCase();
  57.  
  58. if (isForbbiden(title)) {
  59. $(this).parent().remove();
  60. }
  61. });
  62. break;
  63. }
  64. });
  65. })();