Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fallaciousreasoning/d3aceae547cff04edfbca90ebdb3c3cb to your computer and use it in GitHub Desktop.
Save fallaciousreasoning/d3aceae547cff04edfbca90ebdb3c3cb to your computer and use it in GitHub Desktop.
By default, Goodreads sorts the to read shelf by least recently added. This reverses that.
// ==UserScript==
// @name Goodreads: Sort To Read by most recently added.
// @namespace Violentmonkey Scripts
// @match https://www.goodreads.com/*
// @downloadURL
// @grant none
// ==/UserScript==
const getLinksToUpdate = () => {
// Get all links to the to-read shelf that don't specify a sort order.
return document.querySelectorAll('a[href*="/review/list/"][href*="shelf=to-read"]:not([href*="sort="])');
}
const updateLinks = () => {
for (const link of getLinksToUpdate()) {
link.setAttribute('href', link.href + "&sort=date_added")
}
}
updateLinks();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment