Created
November 6, 2019 07:21
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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