SwagTv script

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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

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

var iLoops = 0;
window.setInterval(reloadTimer,1000);
var notes = false;

var k = getK();

$("video-title").remove();
$("commentsCont").remove();

var randomNum = 0;

function getK(){
    $("#video-title").remove();
    $("#commentsCont").remove();
    var m = $('div.thumb-container.next-item a').attr("href");
    if (!m){
        if (!$('span.feed-ajax-next').length)
            m = null;
        else{
            $('span.feed-ajax-next').click();
            setTimeout(function() { getURL() }, 5000);
        }
    }
    return m
}

function getURL(){
    var m = $('div.thumb-container:first a').attr("href");
    k=m;
}

function reloadTimer(){
    iLoops++;
    if (iLoops%5==0)
        console.log(iLoops);
    if (iLoops == 5) {
        console.log(k);
        if ($("#meterDuplicateVideo").is(':visible'))
            randomNum = 8;
        else 
            randomNum = Math.floor(Math.random()*15 + 50);            
        if (k == null) 
            notes = true;
    }

    if (iLoops == randomNum){
        console.log("Match!");
        if ($("#sbvd_capText").is(":visible")) 
            alert('Captcha');
        else {
            if (notes)
                alert("Pick a new category");
            else{
                link = k;
                window.location.href = link;
            }
        }
    }
}