rendered paste body// ==UserScript==// @name ffffoundtape.com: Add mp3 Link// @include http://ffffoundtape.com/// @include http://ffffoundtape.com/*// ==/UserScript==(function() { var ICON = '<img style="border: none; padding: 0 0 0 5px;" src="data:image/gif,GIF89a%0A%00%0A%00%B3%0F%00%F8Cj%D2%D2%D2%EA%EA%EA%F8%F8%F8%FFg%89%F9%F9%F9%FDFY%DC%0B8%FD%F5%F8%F0%27S%FE%90%A6%FBLs%FD%FD%FD%FEWz%F57%5E%FF%FF%FF!%F9%04%01%00%00%0F%00%2C%00%00%00%00%0A%00%0A%00%00%04%3A%104%E9%DCZ%EE9%C5%02%FB%8C%E2%24%1C%F0!%081*(%83%A6%C9%D6%CC%D7U%11%F8%DC%5C%09Y%0C%C0Aaq%F0%05%8E%81A%A3%A8(%08%9E%82%C2%B2%E80X%AD%87C%04%00%3B" >'; setTimeout(function() { if (window.AutoPagerize) { window.AutoPagerize.addFilter(filter); } }, 0); addMp3Link(document); function filter(docs) { docs.forEach(addMp3Link); } function addMp3Link(doc) { Array.forEach(doc.getElementsByTagName('h3'), function(e) { var id = e.id.match(/track_name_(\d+)/)[1]; GM_xmlhttpRequest({ method : 'get', url : 'http://ffffoundtape.com/trackplaylist.php?i=' + id, onload : function(res) { var responseText = res.responseText; var xml = new XML(encodeEntities(responseText)); var playlist = new Namespace(xml.name().uri) var url = xml.playlist::trackList.playlist::track.playlist::location; var a = document.createElement('a'); a.href = url; a.innerHTML = ICON; e.appendChild(a); } }); }); } function encodeEntities(str) { return str .replace('&', '&'); }})();