Skip to content

Instantly share code, notes, and snippets.

@Faldrian
Created August 27, 2014 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Faldrian/c7fd6aacdc540138ab92 to your computer and use it in GitHub Desktop.
Save Faldrian/c7fd6aacdc540138ab92 to your computer and use it in GitHub Desktop.
Bandcamp-CC-Annotation
// ==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