知乎现在官方推的账号简直是让人辣眼睛,一天天的推的都是什么东西,还要付费才能看,付费看个鬼啊,现在随便编个故事都能卖钱了麽。

写了个油猴脚本,屏蔽一些官方账号发送的内容,需要先安装油猴才能使用。

脚本内容如下:

// ==UserScript==
// @name         知乎账号回答屏蔽工具
// @namespace    https://hmilyld.com/
// @version      0.1
// @description  屏蔽知乎盐选等账号
// @author       Hmilyld
// @match        https://www.zhihu.com/*
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @grant        none
// ==/UserScript==

(function () {
    "use strict";

    //需要屏蔽的用户
    var users = ["盐选科普", "故事档案局", "盐选推荐", "真实故事计划"];

    if ($("#ProfileMain").length > 0) {
        new MutationObserver(function (mutations) {
            remove_item();
        }).observe(document.getElementById("ProfileMain"), {
            childList: true,
            subtree: true,
        });
    }

    if ($("#QuestionAnswers-answers").length > 0) {
        new MutationObserver(function (mutations) {
            remove_item();
        }).observe(document.getElementById("QuestionAnswers-answers"), {
            childList: true,
            subtree: true,
        });
    }

    function remove_item() {
        $.each(users, function (idx, item) {
            $("meta[content='" + item + "']")
                .closest(".List-item")
                .hide();
        });
    }

    remove_item();
})();