Skip to content

Instantly share code, notes, and snippets.

View joonaspaakko's full-sized avatar
🍕
Pizza...

Joonas Pääkkö joonaspaakko

🍕
Pizza...
View GitHub Profile
// Mark all Audible library books ON THE CURRENT PAGE as finished or unfinished
// The script is basically a macro: it works by emulating a button click and just automating it for every single book
function markAs(config) {
config = config || {};
var i = 0;
var elements = $(config.finished ? ".mark-as-finished-button" : ".mark-as-unfinished-button");
var l = elements.length;
(function fn() {
const item = elements[i++];
$(item).find("button").click();
/*
NOTE:
1. Makes the assumption that only one layer is selected (only really matters when going down)
2. Doesn't care if the adjacent layer is a group or not
*/
var options = {
direction: 'up',
loop: true,
};