Last active
May 27, 2018 16:50
-
-
Save eheikes/e2535866206b0fdab7f5 to your computer and use it in GitHub Desktop.
Opens a Pitchfork album review in Amazon for music previewing
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
(function(){ | |
var artist = document.querySelector('.artist-links').textContent; | |
var album = document.querySelector('.single-album-tombstone__review-title').textContent; | |
var searchString = artist + ' ' + album; | |
var encoded = encodeURIComponent(searchString.replace(/\bep\b/gi, '')).replace(/ /g, '+'); | |
var url = 'http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Ddigital-music&field-keywords=' + encoded; | |
window.open(url, 'mp3search'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment