SgWin

SG win

30.08.2016 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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        SgWin
// @namespace   vsgw
// @include     https://www.steamgifts.com/
// @include     https://www.steamgifts.com/giveaway/*
// @icon        https://cdn.steamgifts.com/img/favicon.ico
// @version     1.2
// @grant       none
// @description SG win
// ==/UserScript==


function luck(vl,s) {
   var vls = vl.replace(',','');
   vls = vls.replace(' entries','');
   var vln = Math.ceil(vls/2);
   vls = vln.toString();
   if (vls.length>3) {vls = vls.substr(0,vls.length-3) + ',' + vls.substr(-3)}
   if (s == 1) vls += ' entries'; 
   return(vls);
}

var Nent = document.getElementsByClassName('fa fa-tag');
for(var i = 0; i < Nent.length; i++) {       
    if(Nent[i].className == 'fa fa-tag') {
      Nent[i].parentNode.getElementsByTagName('span')[0].innerHTML = luck(Nent[i].parentNode.getElementsByTagName('span')[0].innerHTML,1);
    }
}
Nent = document.getElementsByClassName('sidebar__navigation__item__count live__entry-count');
for(var i = 0; i < Nent.length; i++) {       
    if(Nent[i].className == 'sidebar__navigation__item__count live__entry-count') {
      Nent[i].innerHTML = luck(Nent[i].innerHTML,0);
    }
}