Created
June 24, 2013 02:29
-
-
Save devd/5847399 to your computer and use it in GitHub Desktop.
Simple script to go through your Kindle list of documents and delete stuff.
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
(function () { | |
'use strict'; | |
var todelete = [], | |
a = document.getElementsByClassName('rowHeaderCollapsed'), | |
i = 0, | |
name = "", | |
key = ""; | |
for (i = 0; i < a.length; i = i + 1) { | |
name = ((a[i]).getElementsByClassName('headerTitle')[0]).textContent; | |
key = (a[i]).getElementsByTagName('input')[1].value; | |
if (window.confirm("Do you want to delete " + name + " ?")) { | |
todelete.push(key); | |
} | |
} | |
if (window.confirm("Final Confirmation before deleting. Press cancel if you screwed up somewhere.")) { | |
todelete.forEach(function (a) { | |
Fion.deleteItem("deleteItem_" + a); | |
}); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment