screen

screen for douban

  1. // ==UserScript==
  2.  
  3. // @name screen
  4.  
  5. // @namespace http://tampermonkey.net/
  6.  
  7. // @version 0.1
  8.  
  9. // @description screen for douban
  10.  
  11. // @author rei
  12.  
  13. // @match https://www.douban.com/*
  14.  
  15. // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
  16.  
  17. // @grant none
  18.  
  19. // @run-at document-start
  20.  
  21. // ==/UserScript==
  22.  
  23. //注意引号输入的内容不要多写了空格
  24.  
  25. var keyWordsList = [
  26.  
  27. "沈阳",
  28.  
  29. "关键词2",
  30.  
  31. "关键词3",
  32.  
  33. ];
  34.  
  35. var IDList = [
  36.  
  37. "需要屏蔽的发布者名号",
  38.  
  39. ];
  40.  
  41. //如果需要屏蔽特定转播者可以用以下代码
  42.  
  43. var resharedIDList = [
  44.  
  45. "需要屏蔽的转播者名号",
  46.  
  47. ];
  48.  
  49. window.onload = function(){
  50.  
  51. //如果想要同时屏蔽所有转播加入以下代码,去掉前面的//
  52.  
  53. //$(".status-reshared-wrapper").empty();
  54.  
  55. //$(".reshared_by +*").empty();
  56.  
  57. //$(".reshared_by").empty();
  58.  
  59. //以下屏蔽特定转播者代码
  60.  
  61. $("span.reshared_by > a").each(function(){
  62.  
  63. for(var i=0;i<resharedIDList.length;i++){
  64.  
  65. if($(this).text().indexOf(resharedIDList[i])>=0){
  66.  
  67. var o=$(this).parents('.status-wrapper');
  68.  
  69. o.empty();
  70.  
  71. }
  72.  
  73. }
  74.  
  75. });
  76.  
  77. // 屏蔽纯图片广播,需要把注释去掉(去掉/**/)
  78.  
  79. /* $("[data-action='2']").each(function(){
  80.  
  81. if($(this).find("blockquote").length <= 0)
  82.  
  83. {
  84.  
  85. var o=$(this).parent();
  86.  
  87. o.empty();
  88.  
  89. }
  90.  
  91. }); */
  92.  
  93.  
  94.  
  95. // 屏蔽视频广播
  96.  
  97. $(".block-video").each(function(){
  98.  
  99.  
  100.  
  101. var o=$(this).parents('.status-wrapper');
  102. o.empty();
  103.  
  104.  
  105. });
  106.  
  107. $("p").each(function(){
  108.  
  109. for(var i=0;i<keyWordsList.length;i++){
  110.  
  111. if($(this).text().indexOf(keyWordsList[i])>=0){
  112.  
  113. var o=$(this).parent();
  114.  
  115. o=$(this).parents('.status-wrapper');
  116.  
  117. o.empty();
  118.  
  119. }
  120.  
  121. }
  122.  
  123. });
  124.  
  125. $("a").each(function(){
  126.  
  127. for(var i=0;i<IDList.length;i++){
  128.  
  129. if($(this).text().indexOf(IDList[i])>=0){
  130.  
  131. var o=$(this).parent();
  132.  
  133. o=$(this).parents('.status-wrapper');
  134.  
  135. o.empty();
  136.  
  137. }
  138.  
  139. }
  140.  
  141. });
  142.  
  143. };
  144.  
  145. //请新建油猴脚本复制
  146.  
  147. //keyWordsList 可以放入想屏蔽的关键字