3

I got hundreds of personal documents in my Amazon cloud. They were sent to me few times a day from some site which created e-books basing on RSS content.

Removing them through Amazon's personal documents manager would take hours as it refreshes whole page after each deleted file.

Too many personal documents

How to efficiently remove documents of distinctive title without harming the other ones? Amazon forgot to make it convenient.

1

Please note: The answer was written for the previous Amazon web interface. I don't know if it still works.

It's tricky. Enable development tools of your browser, usually accessible with Ctrl+Alt+I or Cmd+Alt+I, and go to "Console" tab. Modify the following script to fit your needs (see below), paste into that large field in Console tab and execute it by hitting Return or Enter. Soon, the whole page will reload showing the next portion of documents—repeat whole thing then. I agree it's still cumbersome, but far better than doing it manually.

;(function(){

var WORK_ON_PAGE = 1;
var TITLES = ['Bash.org.pl', 'Astronomia.pl', 'Niebezpiecznik.pl'];

var $ = jQuery;
var shouldRemove = function(title) {
  var i;
  for (i = 0; i < TITLES.length; i++) {
    if (TITLES[i] == title) {
      return true;
    }
  }
  return false;
};

var removeItem = function(item) {
  console.log('removing ' + item);
  Fion.deleteItem('deleteItem_' + item);
};

pageList.gotopage(WORK_ON_PAGE);

$('#orderList tr').each(function(){
  var row = $(this);
  var title = row.find('.headerTitle').text();
  if (shouldRemove(title)) {
    var item = row.find('input[name=contentName]').val();
    removeItem(item);
  }
});

return 'wait for refresh';

})();

The above script is configurable. The most important thing is to specify the document titles you want to remove in the 4th line (the one with TITLES). WORK_ON_PAGE option switches to nth page of the document manager. It's very useful when you have a lot of documents which don't match removal criteria on the first page.

It's possible that you can cycle through all pages with pageList.gotopage before removing anything so you can gather info about all documents you want to remove and remove them in once pass. That would be awesome, however I haven't checked that option because I discovered it so late.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.