Greasy Fork镜像 is available in English.

SwagTv script

this script will automatically fetch and go to the next video after the meter goes up.

Fra 17.05.2014. Se den seneste versjonen.

// ==UserScript==
// @name 	SwagTv script
// @namespace 	swagtv
// @version     0.1
// @description	this script will automatically fetch and go to the next video after the meter goes up. 
// @include	http://video.swagbucks.com/*
// ==/UserScript==
//
// --------------------------------------------------------------------

var iLoops = 0;
window.setInterval(reloadTimer,1000);
var doc = document.getElementById("feed-ajax-div");
var notes = null;
var _class = document.getElementsByClassName("thumb-container");

for (var i = 0; i < _class.length; i++) {
	if (_class[i].className == "thumb-container active") {
			var k = i;
			break;			
	}
		
} 
		
var video = document.getElementById("video-title");
video.parentNode.removeChild(video);
var comment = document.getElementById("commentsCont");
comment.parentNode.removeChild(comment);



var randomNum = 0;
var strPercentStart = null;
var link = null;
var div = null;


function reloadTimer(){
	iLoops++;
	console.log(iLoops);
	if (iLoops == 5) {
        console.log("k: "+k);
		strPercentStart = document.getElementById("meterNumber").innerHTML;
		div = document.getElementById("meterDuplicateVideo");
		
		if (div.style.display == 'none') {
			randomNum = Math.floor(Math.random()*15 + 50);
		}
		else {
			randomNum = 8;
		};
		if (k == null) {
            console.log("In K=3");
			//var clickEvent = document.createEvent('MouseEvents');
			//clickEvent.initEvent('click', true, true);
			//document.getElementsByClassName("feed-ajax-next")[0].dispatchEvent(clickEvent);
            document.getElementsByClassName("feed-ajax-next")[0].click();
			k = -1;
		}
		
	};
	
	if (iLoops == randomNum){
        	console.log(k);
			if (strPercentStart == '90%') {
				alert('Captcha');
			}
        	/*else if (k == 4){
            	k = -1;
                document.getElementsByClassName("feed-ajax-next")[0].click();
                link = document.getElementsByClassName("thumb-link")[k+1].href;
				window.location.href = link;
            }*/
			else {
				link = document.getElementsByClassName("thumb-link")[k+1].href;
				window.location.href = link;
			}
	}
			
		
};
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元