Skip to content

Instantly share code, notes, and snippets.

@dekz
Created February 22, 2010 10:57
Show Gist options
  • Save dekz/311000 to your computer and use it in GitHub Desktop.
Save dekz/311000 to your computer and use it in GitHub Desktop.
//http://nzbs.org/index.php?action=getnzb&nzbid=307942
function addToSABnzbdFromNZBORG() {
// Set the image to an in-progress image
var img = chrome.extension.getURL('images/sab2_16_fetching.png');
$(this).find('img').attr("src", img);
// Find the newzbin id from the href
var url = 'http://nzbs.org/'
var nzburl = url.concat($(this).attr('href'));
var addLink = this;
addToSABnzbd(addLink, nzburl, "addurl");
return false;
}
$('table a[href*="index.php?action=getnzb&nzbid="]').each(function() {
// Change the title to "Send to SABnzbd"
var img = chrome.extension.getURL('/images/sab2_16.png');
var href = $(this).attr('href');
var link = '<a class="addSABnzbd" href="' + href + '"><img src="' + img + '" /></a> ';
$(this).before(link);
// Change the on click handler to send to sabnzbd
$('.addSABnzbd').click(addToSABnzbdFromNZBORG);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment