Skip to content

Instantly share code, notes, and snippets.

@ShannonScott
Last active August 9, 2019 22:13
Show Gist options
  • Save ShannonScott/bb1f4cd21566068cb5a4cc58adc6b56b to your computer and use it in GitHub Desktop.
Save ShannonScott/bb1f4cd21566068cb5a4cc58adc6b56b to your computer and use it in GitHub Desktop.
[Amazon MP3 Cart] Format Amazon MP3 cart for easy backup. #amazon

Make a new (empty) Chrome bookmark, and copy the following to the URL field:

javascript:(function(){var output = ""; var mlist = document.getElementsByClassName('MusicCartReviewListFullPage')[0]; for (ii = 0; ii < mlist.children.length; ii += 2) { var item = mlist.children[ii]; try { var entry = item.getElementsByClassName('a-fixed-left-grid-inner')[0]; var img_info = entry.children[0].firstElementChild.firstElementChild; var img_url = img_info.getAttribute('src'); output += img_info.outerHTML; var album_info = entry.children[1]; output += '</br>'; output += album_info.children[0].firstElementChild.outerHTML; output += '</br>'; output += album_info.children[2].firstElementChild.outerHTML; output += '</br>'; output += '</br>'; } catch(err) { alert(err.message); console.log(ii); break; } } document.write(output)})();
/* Run the following in the Chrome JS console while on the Amazon MP3 cart page */
var output = "";
var mlist = document.getElementsByClassName('MusicCartReviewListFullPage')[0];
for (ii = 0; ii < mlist.children.length; ii += 2) {
var item = mlist.children[ii];
try {
var entry = item.getElementsByClassName('a-fixed-left-grid-inner')[0];
var img_info = entry.children[0].firstElementChild.firstElementChild;
var img_url = img_info.getAttribute('src');
output += img_info.outerHTML;
var album_info = entry.children[1];
output += '</br>';
output += album_info.children[0].firstElementChild.outerHTML;
output += '</br>';
output += album_info.children[2].firstElementChild.outerHTML;
output += '</br>'; output += '</br>';
} catch(err) {
alert(err.message);
console.log(ii);
break;
}
}
document.write(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment