Skip to content

Instantly share code, notes, and snippets.

@devd
Created June 24, 2013 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devd/5847399 to your computer and use it in GitHub Desktop.
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.
(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