Skip to content

Instantly share code, notes, and snippets.

@landakram
Last active October 11, 2023 15:07
Show Gist options
  • Save landakram/4f7e81393c73db51bfd022398466ae25 to your computer and use it in GitHub Desktop.
Save landakram/4f7e81393c73db51bfd022398466ae25 to your computer and use it in GitHub Desktop.
Removing 800+ New York Times Audio Digests from Amazon's "Your Content"

Removing 800+ New York Times Audio Digests from Amazon's "Your Content"

I recently started using family sharing to share audiobooks with my family and partner. I wanted to manually select which audiobooks to share by visiting Amazon's "Your content" page.

When I visited that page, to my horror, I had ~800 New York Times Audio Digest "audiobooks", one every day for the past ~2 years, to which I never listened. These entries crowded out my actual audiobooks, making it unfeasible to actually choose and share anything.

Amazon's page also makes it very difficult to clean this up:

  • There's no "Select All" functionality
  • You can only select 10 items at a time for bulk actions

Here is a quick script that automates deleting these audio digest entries in groups of 10:

  var nytimes = function() { jQuery("div[title=' The New York Times']").slice(0, 10).click() }
  var del = function() { jQuery('span:contains("Delete")').click() }
  var confirm = function() { jQuery("span:contains(' Yes, Delete permanently')").click() }
  var ok = function() { jQuery('span:contains(" OK")').click() }

  var sequence = function(steps, timeout, callback) { 
    var step = 0;
    var f = function() {
      setTimeout(function() { 
        steps[step]();
        step += 1;
        if (step >= steps.length) { 
          callback();
        } 
        else { 
          f();
        }
      }, timeout);
    }
    f();
  }

  var deleteLoop = function() {
    sequence([
      nytimes,
      del,
      confirm,
      ok
    ], 2000, deleteLoop);
  };

  deleteLoop();

First, make sure that you unsubscribe from these daily digests by following Audible's instructions.

Then, paste the above script into the console in the "Your content" page. It should start running automatically.

Note: The page will usually autoload the next entries, but sometimes it doesn't, or there are no audio digest entries left. In this case, I recommend manually searching "The New York Times" in the right sidebar and the script will automatically resume.

@garretto
Copy link

garretto commented Dec 2, 2020

You can also do a support chat with them to unsubscribe and delete all the previous entries:
https://www.audible.com/contactus?n1=somethingelse&n2=topic_not_listed#chat

@micdonato
Copy link

Ouch I get

VM541:1 Uncaught ReferenceError: jQuery is not defined
    at Array.nytimes (<anonymous>:1:30)
    at <anonymous>:10:20

And I have 738 NYT, 866 WaPo, 815 WSJ digests to delete :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment