Created
August 27, 2014 13:24
-
-
Save Faldrian/c7fd6aacdc540138ab92 to your computer and use it in GitHub Desktop.
Bandcamp-CC-Annotation
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
// ==UserScript== | |
// @name Bandcamp-CC-filter | |
// @namespace javafant | |
// @description Shows the license in the track overview | |
// @include http://bandcamp.com/* | |
// @include https://bandcamp.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
$(function() { | |
$('li.item').each(function(index, element) { | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: $(this).find('a').attr('href'), | |
onload: function(data) { | |
// Hol die Lizenz halt manuell per Stringoperationen da raus | |
var licenseStr = data.responseText.match(/<div id="license"(.|[\r\n])*?<\/div>/mgi)[0] | |
var licenseStr = licenseStr.replace('id="license"',""); | |
$(element).find('a').append(licenseStr); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment