RapidShare download ready alert

By Marcin Zieliński Last update Jul 31, 2007 — Installed 5,075 times. Daily Installs: 0, 0, 1, 2, 1, 0, 2, 0, 0, 0, 2, 1, 4, 0, 0, 1, 2, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 3
// ==UserScript==
// @author		Marcin Zielinski - http://kxp.pl
// @name		RapidShare download ready alert
// @description		RapidShare download ready alert
// @include		http*://*rapidshare.de/*
// @include		http*://*rapidshare.com/*
// ==/UserScript==

var show_alert;

function check_rapid() {
	if (document.getElementById("dl").innerHTML.indexOf("seconds")!=-1 ||
            document.getElementById("dl").innerHTML.indexOf("minutes")!=-1) {
		show_alert=1;
		setTimeout(check_rapid, 1000);
	} else
	if ((document.getElementById("dl").innerHTML.indexOf("submit") != -1) &&
		(show_alert==1)) {
		alert('Download ready!');
	}
}

(function() {
	if (document.body.parentNode.innerHTML.indexOf("unescape") != -1) {
		show_alert=0;
		setTimeout(check_rapid, 5000);
	}
})();