Sharecash autodownload

By timendum Last update Nov 9, 2009 — Installed 25,349 times. Daily Installs: 202, 198, 208, 196, 335, 386, 377, 299, 332, 353, 360, 389, 387, 631, 622, 458, 404, 474, 479, 453, 361, 344, 303, 384, 349, 402, 449, 485, 409, 487, 404, 487

There are 12 previous versions of this script.

// ==UserScript==
// @name           Sharecash autodownload
// @author         Timendum
// @namespace      sharecash
// @description    Auto-download files from sharecash.org
// @include        http://sharecash.org/download.php?file=*
// @include        http://sharecash.org/download.php?id=*
// @require        http://usocheckup.dune.net/38584.js?maxage=5
// @version        4.0.1
// ==/UserScript==

var ShareTimendum = {
	white: [],
	frame: [],
	frameCount: 0,
	init: function() {
		ShareTimendum.initWhiteList();
	},
	initWhiteList: function() {
		var frameList = document.getElementsByTagName('iframe');
		for (var i=0; i < frameist.length; i++) {
			ShareTimendum.whitepush(frameList[i]);
		
		setTimeout(ShareTimendum.checkFrame, 1500);
	},
	checkFrame: function() {
		var frameList = document.getElementsByTagName('iframe');
		for (var i=0; i < frameList.length; i++) {
			if (ShareTimendum.white.indexOf(frameList[i]) == -1) {
				try {
					var tmp = document.getElementsByTagName('iframe')[i].contentDocument.baseURI;
				} catch(e) {
					ShareTimendum.frame.push(i);
				}
			}
		}
		if (ShareTimendum.frame.length == 0) {
			setTimeout(ShareTimendum.checkFrame, 1000);
		} else {
			setTimeout(ShareTimendum.makeStep, 500);
		}
	},
	makeStep: function() {
		if (ShareTimendum.frame.length == 0)
			return;
		
		if (ShareTimendum.frameCount == ShareTimendum.frame.length) {
			ShareTimendum.frameCount = 0;
		}
		document.getElementsByTagName('iframe')[ShareTimendum.frameCount].src = document.getElementsByTagName('iframe')[ShareTimendum.frameCount].src;
		ShareTimendum.frameCount++;
		setTimeout(ShareTimendum.makeStep, 2500);
	},
};

setTimeout(ShareTimendum.init, 100);