// ==UserScript== // @name 屏蔽斗鱼板块 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 屏蔽斗鱼指定板块 tag 可指定某些主播除外 dy-name // @author Vipcw // @match https://www.douyu.com/directory/all // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 屏蔽板块列表 let shieldList = [ '绝地求生', '王者荣耀', '刺激战场' ] // 指定某些主播不被屏蔽 let exemptionList = [ '指法芬芳张大仙' ] let isShieldList = [] shieldList.map(shieldItem=>{ isShieldList.push({ name: shieldItem, number: 0, anchors: [] }) $('.play-list li .mes-tit .tag').map((index, item)=>{ if(shieldItem === $(item).html()){ $(item).parents('.play-list-link').parent().hide() isShieldList[isShieldList.length - 1].number++ isShieldList[isShieldList.length - 1].anchors.push( $(item).parents('.play-list-link').find('span.dy-name').html() ) } }) }) exemptionList.map(exemptionItem=>{ $('.play-list li span.dy-name').map((index, item)=>{ if(exemptionItem === $(item).html()){ $(item).parents('.play-list-link').parent().show() } }) }) console.log(isShieldList) console.log(exemptionList) })();