Dread_Boy / Steamgifts auto-entry

// ==UserScript==
// @name Steamgifts auto-entry
// @description Automatically enter any available giveaway on steamgifts.com
// @author  Matic Leva aka Dread_Boy
// @version 1.0.2
// @downloadURL https://openuserjs.org/install/Dread_Boy/Steamgifts_auto-entry.user.js
// @updateURL https://openuserjs.org/meta/Dread_Boy/Steamgifts_auto-entry.meta.js
// @namespace http://vozzel.net
// @include https://www.steamgifts.com/*
// @license https://creativecommons.org/licenses/by-sa/4.0/
// ==/UserScript==

var entry = $(".sidebar__entry-insert");
if(entry.length === 0) //we are on landing page
{
	setTimeout(function(){
		var links = $(".giveaway__row-inner-wrap:not(.is-faded)").filter(function(index){return $(".giveaway__column--contributor-level--negative", this).length === 0});

		if(links.length > 0){
			$(".giveaway__heading__name", links[0])[0].click();
		}
	}, 10000);


}
else{
	entry[0].click();
}


setTimeout(function(){
	window.location = "https://www.steamgifts.com";
}, 20000);