Skip to content

Instantly share code, notes, and snippets.

@to
Created August 8, 2012 17:18
Show Gist options
  • Save to/3296754 to your computer and use it in GitHub Desktop.
Save to/3296754 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @id www.rbmaradio.com-9a6f2253-11bd-4aa4-9f5c-cadfa1899da0@scriptish
// @name RBMA Radio - Add Download Link
// @include http://www.rbmaradio.com/shows/*
// @run-at window-load
// ==/UserScript==
var url = unsafeWindow.gon.show.akamai_url;
var ul = document.querySelector('.l-more ul');
var li = document.createElement('li');
ul.insertBefore(li, ul.childNodes[0]);
var span = document.createElement('span');
span.textContent = 'Files';
li.appendChild(span);
var div = document.createElement('div');
div.className = 'links';
li.appendChild(div);
[96, 128, 256].forEach(function(rate){
var link = document.createElement('a');
link.href = url + '&cbr=' + rate;
link.textContent = rate;
link.setAttribute('data-bypass', 'true');
div.appendChild(link);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment