Luogu-Benben-Deleter

一键删除洛谷系统生成的所有犇犇

Stan na 17-09-2019. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Luogu-Benben-Deleter
// @version      1.0
// @description  一键删除洛谷系统生成的所有犇犇
// @author       Llf0703
// @match        *://www.luogu.org/*
// @match        *://www.luogu.com.cn/*
// @grant        none
// @namespace https://greasyfork.org/users/372864
// ==/UserScript==

(function () {
    'use strict';

    let uid = window._feInjection.currentUser.uid;

    $('.popup-button').click(function () {
        $('.apps').append('<a id="bb-del" data-v-1f4667be="" data-v-1758e89a="" href="javascript:void 0" class="color-none">清理犇犇</a>');
        $('#bb-del').click(function () {
            $.get('https://www.luogu.org/feed/user/' + uid, function (data) {
                for (let i = 0; ; i += 2) {
                    let cur = $(data)[i];
                    if (cur.children[1] === undefined) {
                        break;
                    }
                    if (cur.children[1].children[1].children[0].firstChild.toString() !== "[object Text]") {
                        continue;
                    }
                    let id = cur.children[1].children[0].children[0].children[1].dataset.feedId;
                    $.post("/api/feed/delete/" + id);
                }
            });
        });
    })
})();