Created
September 20, 2013 12:52
-
-
Save Kalli/6637015 to your computer and use it in GitHub Desktop.
Javascript bookmarklet for getting release information of a Discogs (http://www.discogs.com) release page, for easy copy/pasting to a spreadsheet or the like. Use a bookmarklet maker like the Bookmarlet Crunchinator (http://ted.mielczarek.org/code/mozilla/bookmarklet.html) to create a bookmarklet version
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
var artist = $('.profile h1 span').first().text().replace(/\n/g,"").replace(/\s\s+/g,""); | |
var release = $('.profile h1 span').last().text().replace(/\n/g,"").replace(/\s\s+/g,""); | |
var label = $('.profile .content').first().text().replace(/\n/g,"").replace(/\s\s+/g,""); | |
var releasedate= $('.profile .content:eq(3)').text().replace(/\n/g,"").replace(/\s\s+/g,""); | |
var style = $('.profile .content:eq(5)').text().replace(/\n/g,"").replace(/\s\s+/g,""); | |
// if releasedate has full date, get just the year; | |
if(releasedate.length>4){; | |
releasedate = releasedate.slice(-4); | |
}; | |
var url = document.location.toString(); | |
document.write(artist+"\t"+release+"\t"+label+"\t"+releasedate+"\t"+style+"\t=HYPERLINK(\""+url+"\",\"Discogs Link\")"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment