posting for future readers:
I got this from a forum post too but forgot the original source, feel free to tag the OP of this (enter this as a new userscript in a userscript manager, e.g., Violentmonkey):
[u]
```
// ==UserScript==
// @name nuke favs
// @namespace Violentmonkey Scripts
// @match https://*.donmai.us/profile
// @grant none
// @version 1.0
// @author -
// @description 4/13/2022, 2:43:37 PM
// ==/UserScript==
const sleep = ms => new Promise(r => setTimeout(r, ms));
async function getPage() {
let username = document.body.attributes["data-current-user-name"].value;
return fetch(`/posts.json?tags=fav:${username}+-paid_reward&limit=200`).then(resp => resp.json());
}
async function unfavoritePost(id) {
return fetch(`/favorites/${id}.json`, {
method: "delete",
headers: {
"x-csrf-token": Danbooru.Utility.meta("csrf-token")
}
});
}
async function nuke() {
let posts = await getPage();
while (true) {
if (posts.length === 0) {
posts = await getPage();
if (posts.length === 0) break;
}
let item = posts.pop();
if (item.id) {
await unfavoritePost(item.id);
console.log(`Unfavorited post ${item.id}`);
await sleep(1000);
}
}
alert("done");
}
function nukeSync() { nuke().then(); }
$(`
<a href="javascript:void(0)">Delete all</a>
`).click(nukeSync).appendTo(".user-statistics > tbody:nth-child(1) > tr:nth-child(8) > td:nth-child(2)");
```
[/u]