// ==UserScript== // @name Hype Machine Download Links // @namespace http://www.rhyley.org/gm/ // @description Add download links next to tracks on The Hype Machine. Links don't always work -- if the track does not have a "listen" link, it *probably* is no longer online, but this is not always true. // @include http://hypem.com/* // ==/UserScript== tracks = document.evaluate("//a[contains(@href,'/track/')]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); if (tracks && tracks.snapshotLength!=0) { dIcon = '' for (var i = 0; i < tracks.snapshotLength; i++) { tLink = tracks.snapshotItem(i); tNum = tLink.href; tNum = tNum.split('/track/'); tNum = tNum[1]; a = document.createElement('a'); a.href = "http://hypem.com/serve/r/500/" + tNum + "/";; a.innerHTML = dIcon; tLink.parentNode.insertBefore(a,tLink.nextSibling); tLink.parentNode.insertBefore(document.createTextNode(' '),tLink.nextSibling); } }