Last active
November 4, 2020 10:46
-
-
Save Hans5958/cca411858ca600958778bcdbcaca6df3 to your computer and use it in GitHub Desktop.
Clean/remove all empty sticky notes created on Note.ly with this simple JS script
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 notes = [] // https://gist.github.com/Hans5958/4155e60254f19b5f04cbda0f20133aef | |
emptyNotes = [] | |
window.notes.forEach(note => { | |
if (note.content === "") { | |
emptyNotes.push(note.dbId) | |
} else { | |
console.log(note.dbId, note.content) | |
} | |
}) | |
emptyNotes.forEach(db_id => { | |
$.ajax({ | |
type : "POST", | |
url: "submit.php", | |
data: {action: "delete_note", db_id}, | |
success: function(res) { | |
console.log(`Successfully removed ${db_id}!`) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment