Danbooru

Delete all or several favorites

Posted under Bugs & Features

I searched around and found an old post here which uses this script:

javascript:for (i in (thumbs = document.getElementById("post-list").getElementsByTagName("span"))) if (/thumb/.test(thumbs.getAttribute("class"))) Favorite.destroy(thumbs.id.replace(/p/,''));However, it doesn't seem to do anything for me.Is there another way I can delete a bunch of favorites at a time or even just like a page at a time?Thanks

Firstly, I'm unsure of whether this works on regular accounts, but I don't see why it wouldn't.

Open your facorites list. At the left towards the top under the tag search box should be a Modes dropdown box. Select "Unfavorite" from the list; any image you click on will be removed from your favorites until you switch the mode back to View. Middle-clicking will still open the image in a new tab if you want to see it full size without flipping the mode box back and forth.

Fastest way I can think of doing it using the basic site features.

Well, you can use the newer code, like this:

javascript:function unfav() {var time = 200; $("#posts .post-preview").each(function(index){var i = $(this).data("id"); setTimeout( function(){ Danbooru.Favorite.destroy(i);}, time); time +=200; }); false;}; unfav();

It pretty much imitates the unfavorite mode with you clicking on next post every 1/5th of a second, for every post on the page.

Type-kun said:

Well, you can use the newer code, like this:

javascript:function unfav() {var time = 200; $("#posts .post-preview").each(function(index){var i = $(this).data("id"); setTimeout( function(){ Danbooru.Favorite.destroy(i);}, time); time +=200; }); false;}; unfav();

It pretty much imitates the unfavorite mode with you clicking on next post every 1/5th of a second, for every post on the page.

This works, thank you. Made bookmarklet.

Type-kun said:

Well, you can use the newer code, like this:

javascript:function unfav() {var time = 200; $("#posts .post-preview").each(function(index){var i = $(this).data("id"); setTimeout( function(){ Danbooru.Favorite.destroy(i);}, time); time +=200; }); false;}; unfav();

It pretty much imitates the unfavorite mode with you clicking on next post every 1/5th of a second, for every post on the page.

Idk how to use this. How do I make that work and save it as bookmarklet, Tl; dr, could you explain tutorial for this how to use JavaScript in Danbooru. Do I use the API or how?
I'm on the same situation.

1