Skip to content

Instantly share code, notes, and snippets.

@sillygwailo
Forked from lightningdb/goodreads-bookmarklet.js
Last active January 22, 2022 18:31
Show Gist options
  • Save sillygwailo/1555879ce4a1440e2c848be032d612bc to your computer and use it in GitHub Desktop.
Save sillygwailo/1555879ce4a1440e2c848be032d612bc to your computer and use it in GitHub Desktop.
Add to Goodreads from Amazon.com book page bookmarklet
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