Last active
May 22, 2024 10:16
-
-
Save JustGAST/39e3bdd8acbfa69f19a4f15110a64b12 to your computer and use it in GitHub Desktop.
Raindrop.io remove all empty collections. (Because raindrop have no ability to select multiple collections to delete them). Run in console on page app.raindrop.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elems = document.getElementsByClassName('collection'); | |
for (let idx in elems) { | |
var elem = elems[idx]; | |
var countElem = elem.querySelector('.count'); | |
if (countElem.textContent !== "") { | |
continue; | |
} | |
var actionsElem = elem.querySelector('.actions'); | |
if (!actionsElem) { | |
continue; | |
} | |
var actionsId = actionsElem.id; | |
var collectionId = actionsId.replace('side-collection-', ''); | |
fetch('https://api.raindrop.io/v1/collection/'+collectionId, { | |
method: 'DELETE', | |
credentials: 'include', | |
}) | |
.then(res => res.text()) | |
.then(res => console.log(res)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment