// ==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 // @downloadURL https://update.greasyfork.icu/scripts/390211/Luogu-Benben-Deleter.user.js // @updateURL https://update.greasyfork.icu/scripts/390211/Luogu-Benben-Deleter.meta.js // ==/UserScript== (function () { 'use strict'; let uid = window._feInjection.currentUser.uid; $('.popup-button').click(function () { $('.apps').append('清理犇犇'); $('#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); } }); }); }) })();