Forked from lightningdb/goodreads-bookmarklet.js
Last active
January 22, 2022 18:31
-
-
Save sillygwailo/1555879ce4a1440e2c848be032d612bc to your computer and use it in GitHub Desktop.
Add to Goodreads from Amazon.com book page bookmarklet
This file contains hidden or 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
javascript: var asin_elements, asin; | |
asin_elements = document.getElementsByName('ASIN'); | |
if (asin_elements.length == 0) { | |
asin_elements = document.getElementsByName('ASIN.0'); | |
}; | |
if (asin_elements.length == 0) { | |
alert('Sorry, this doesn\'t appear to be an Amazon book page.'); | |
} else { | |
asin = asin_elements[0].value; | |
if (asin.match(/\D/) === null) { | |
location.href = 'http://www.goodreads.com/review/isbn/' + asin, 'add_review' | |
} else { | |
location.href = 'https://www.goodreads.com/search?q=' + asin; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment