微博拉黑所有点赞用户

批量拉黑微博点赞用户

目前为 2019-01-29 提交的版本。查看 最新版本

// ==UserScript==
// @name         微博拉黑所有点赞用户
// @namespace    http://yenkn.com/
// @version      0.1
// @description  批量拉黑微博点赞用户
// @author       Yenkn
// @match        *://weibo.com/*
// @require      https://cdn.bootcss.com/xhook/1.4.9/xhook.min.js
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.blockAll = async () => {
  const users = document.querySelectorAll('ul[node-type="commentLikeList"] li[uid]');
  const uids = Array.from(users).map(x => x.attributes.uid.value);

  for(const uid of uids) {
    const res = await fetch('https://weibo.com/aj/filter/block?ajwvr=6', {
      method: 'POST',
      body: `uid=${uid}&filter_type=1&status=1&interact=1&follow=1`,
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
      }
    })
    const data = await res.json()
    const item = document.querySelector(`li[uid="${uid}"]`)
    item.style.height = 'auto'
    item.style.lineHeight = 'inherit'
    item.appendChild(document.createTextNode(data.msg))
  }
}

xhook.after(function(request, response) {
  if(request.url.indexOf('/aj/like/object/big') !== -1) {
    response.text = response.text.replace('<\\/ul>','<\\/ul><div><a href=\\"javascript:blockAll();\\">拉黑本页全部<\\/a><\\/div>');
  }
});
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址