parsiad / SABnzbd Open Containing Directory

// ==UserScript==
// @name        SABnzbd Open Containing Directory
// @author      Parsiad Azimzadeh
// @description Creates an open containing directory icon beside each downloaded item in SABnzbd.
// @include     http://localhost:8080/*
// @grant       none
// ==/UserScript==

function makeFolders() {
	if($('.open-directory-link').size() == 0) {
		$('.historyTitle').each(
			function(index) {
				var path = $(this).find('.rssTable tr:nth-child(6) td:nth-child(2)').html();
				$(this).append('<a class="open-directory-link" href="file:///' + path + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA3kQAAIGwAAB53wAA1IAAADo0AAAzkI20cv8AAAJvSURBVHjalJJNiFdlFMZ/7733f0cFhcFFujFFqJaCSzNFJDUQTNJNi1aGEQijkenGRaZjmwEXMSCjtAg/dqkVagmlBDIQJYNgMbbxMxmYHKf53/d8ubij42SbDhwOB855znPOc1JEcP7g2y8VZXXf3XA33JQw4frfC986cPTkd/yHfbnzVd4bvPksr775bNuistNzb9PeUy8U2/513x7ZsXbzsjn3f5yyAlfFTanq2nvoTj5fW1U99b0NH31F2GHCDUxxM8KEdw5d5sze1efceumYYKUSLpgqd8ulG4ELz4DcHbyfCAd3wh3cCDOah31sP3LlBabH31/O6MSC3bOAInwaxIhpgBlXpm7vxFVwVUIzbkKYUad63qzV8Bkmo9fGGB0eA3dcFXNtQUxQzYRlVIV63gJW2I3XT+xYHmZCV8IrdyfCCHdu/PAHWz69wP+xy/0b+fqXiZEqwghzfhr6k02fvEHYIcIUF8ElE9rgWXDp4iKENHhuV5x68Jirw3doXn73wyLcyZMZD6WeUxBm0zILYUKI4JoJUVxyO8CV7kTD96d/5s78NUNVla4W7salL35n/a6VbaNmQjKRM54bTNrcpSFECBWq5NweHuHXsRUP06JX9pc6SVGUJa+tWYzLPy0TbQ8cT10ylhtc2m8PUx7dfcCVa8HUkrX7Bvs//qsIIZ09uCVaeQWzPDuqYJoxa0Hd2s8u8jijvVvHPz92prevr4+gpLo1MXfDyPiyPXNT82YiiH/LUgQUiegEBKQEVV1CUV0HGBgYaP9IonOxW8//rVN0PiClVZBI0HYAaTpCggRBQohcenfo+XlPBgA7a9ENL1NV6gAAAABJRU5ErkJggg==" alt="Open Directory" /></a>');
			}
		);
    }
}

setInterval(makeFolders, 16);