Greasy Fork

Greasy Fork is available in English.

【微博】自动批量删除微博

批量删除微博

当前为 2019-09-02 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         【微博】自动批量删除微博
// @namespace    http://tuite.fun
// @version      1.3
// @description  批量删除微博
// @author       tuite
// @match        https://weibo.com/*/profile*
// @grant        none
// ==/UserScript==
(function() {
    'use strict';

    // Your code here...
    
    // 定时器id
    var intervalIndex = document.creatElement('input');
    intervalIndex.style.cssText = 'display:none';
    intervalIndex.id = 'hao_jiu.intervalIndex';
    document.body.appendChild(intervalIndex);
    
    // 开始按钮
    var startBtn = document.creatElement('button');
    startBtn.style.cssText = 'position: absolute; right:0; top: 40%;';
    startBtn.innerHTML = '开始删除';
    startBtn.onclick = initDel();
    document.body.appendChild(startBtn);
    
    // 停止按钮
    var endBtn = document.creatElement('button');
    endBtn.style.cssText = 'position: absolute; right:0; top: 45%;';
    endBtn.innerHTML = '停止删除';
    endBtn.onclick = window.clearInterval(document.getElementById('hao_jiu.intervalIndex').value);
    document.body.appendChild(endBtn);
})();

// 初始化定时器
function initDel() {
    //1.5秒执行一次删除
    var intervalInt = self.setInterval(function(){
            if (document.querySelector('a[action-type="feed_list_delete"]')) {
                document.querySelector('a[action-type="feed_list_delete"]').click();
                document.querySelector('a[node-type="ok"]').click();
            } else {
                window.clearInterval(document.getElementById('hao_jiu.intervalIndex').value)
            }
         }, 2000);
    var intervalIntInput = document.getElementById('hao_jiu.intervalIndex');
    intervalIntInput.value = intervalInt;
}