AMZMA / Yet Another Kaskus Anti-BotIklan

// ==UserScript==
// @id             kaskus_iklan
// @name           Yet Another Kaskus Anti-BotIklan
// @version        6.51.14
// @namespace      amzma@deviantart.com
// @author         AMZMA
// @description    Memasukkan iklan kaskus ke kakus | http://kask.us/hHdHC
// @homepageURL    http://goo.gl/UZLlwP
// @icon           http://puu.sh/98CKG
// @updateURL      
// @downloadURL    https://openuserjs.org/install/AMZMA/Yet_Another_Kaskus_Anti-BotIklan.user.js
// @include        http://www.kaskus.co.id/forum/*
// @include        http://m.kaskus.co.id/forum/*
// @require        http://code.jquery.com/jquery-1.10.1.min.js
// @run-at         document-start
// ==/UserScript==

$.extend($.expr[":"], {
    "awal": function(elem, i, data, set) {
        var text = $.trim($(elem).text()),
            term = data[3];
        return text.indexOf(term) === 0;
    }
});

$(document).ready(function() {
	var _0x3df8 = ["\x6A\x75\x61\x6C", "\x70\x72\x6F\x6D\x6F", "\x68\x61\x72\x67\x61\x2D\x6D\x75\x72\x61\x68", "\x2D\x6D\x6C\x2D", "\x2D\x70\x65\x6E\x69\x73\x2D", "\x2D\x6A\x61\x76\x2D", "\x2D\x74\x6F\x70\x6C\x65", "\x2D\x74\x6F\x67\x65", "\x2D\x74\x6F\x6B\x65\x74", "\x74\x61\x6E\x74\x65\x2D\x67\x69\x72\x61\x6E\x67", "\x73\x79\x61\x68\x72\x69\x6E\x69", "\x73\x65\x78", "\x62\x75\x67\x69\x6C", "\x2D\x73\x65\x6D\x6F\x6B", "\x65\x6E\x74\x30\x74", "\x70\x65\x6E\x65\x74\x72\x61\x73\x69", "\x74\x61\x6E\x70\x61\x2D\x6D\x6F\x64\x61\x6C", "\x6F\x6E\x6C\x69\x6E\x65\x2D\x61\x67\x61\x6E\x2D\x62\x65\x72\x6D\x61\x6E\x66\x61\x61\x74", "\x72\x65\x6B\x65\x6E\x69\x6E\x67\x2D\x61\x67\x61\x6E\x2D\x67\x65\x6E\x64\x75\x74", "\x72\x65\x6B\x65\x6E\x69\x6E\x67\x2D\x61\x67\x61\x6E\x2D\x62\x65\x72\x74\x61\x6D\x62\x61\x68", "\x73\x75\x6B\x73\x65\x73\x2D\x62\x61\x6E\x67\x65\x74\x2D\x67\x61\x6E", "\x73\x75\x6B\x73\x65\x73\x2D\x67\x61\x6D\x65\x72", "\x70\x65\x6C\x75\x61\x6E\x67\x2D\x62\x69\x73\x6E\x69\x73\x2D", "\x6B\x61\x79\x61\x2D\x6D\x65\x6E\x64\x61\x64\x61\x6B", "\x6A\x75\x74\x61\x77\x61\x6E\x2D\x6D\x65\x6E\x64\x61\x64\x61\x6B", "\x64\x61\x70\x65\x74\x2D\x64\x75\x69\x74\x2D", "\x75\x61\x6E\x67\x2D\x6E\x79\x61\x74\x61", "\x6D\x61\x69\x6E\x2D\x66\x6F\x6F\x74\x62\x61\x6C\x2D\x6D\x61\x6E\x61\x67\x65\x72", "\x6D\x61\x69\x6E\x2D\x66\x6F\x6F\x74\x62\x61\x6C\x6C\x2D\x6D\x61\x6E\x61\x67\x65\x72", "\x70\x65\x63\x69\x6E\x74\x61\x2D\x67\x61\x6D\x65\x2D\x62\x6F\x6C\x61", "\x62\x69\x6F\x73\x6B\x6F\x70\x2D\x6F\x6E\x6C\x69\x6E\x65", "\x67\x6F\x6C\x64\x65\x6E\x2D\x63\x6F\x77", "\x74\x72\x69\x6B\x2D\x62\x72\x6F\x77\x73\x69\x6E\x67\x2D\x79\x61\x6E\x67", "\x62\x65\x72\x62\x61\x73\x69\x73\x2D\x73\x74\x72\x61\x74\x65\x67\x69", "\x62\x69\x73\x6E\x69\x73\x2D\x6F\x6E\x6C\x69\x6E\x65", "\x64\x6F\x6E\x61\x74\x75\x72\x2D\x67\x72\x61\x74\x69\x73", "\x2D\x2D\x2D\x67\x74\x2D\x2D\x2D", "\x2D\x2D\x2D\x74\x75\x6D\x70\x65\x68\x2D\x2D", "\x62\x61\x72\x65\x74\x73\x63\x72\x61\x74\x63\x68", "\x67\x6F\x6C\x64\x65\x6E\x2D\x73\x69\x67\x6E\x61\x6C", "\x2D\x31\x30\x30\x2D\x6E\x6F\x2D\x73\x63\x61\x6D", "\x2D\x6C\x69\x76\x65\x2D\x73\x74\x72\x65\x61\x6D", "\x61\x67\x65\x6E\x2D\x62\x6F\x6C\x61", "\x62\x6E\x69\x62", "\x61\x73\x6C\x69\x2D\x6F\x72\x69", "\x63\x79\x6E\x74\x68\x69\x61", "\x70\x75\x74\x72\x79\x2D\x73\x68\x6F\x70", "\x2D\x68\x6F\x72\x6E\x79", "\x2D\x6D\x72\x2D\x70\x2D", "\x72\x65\x61\x64\x79\x2D\x73\x74\x6F\x63\x6B", "\x72\x61\x6A\x61\x2D\x70\x6F\x6E\x73\x65\x6C", "\x70\x69\x6E\x35\x32\x32\x37\x32\x36\x62\x61", "\x2C", "\x6A\x6F\x69\x6E", "\x2A\x3E\x61\x5B\x68\x72\x65\x66\x2A\x3D\x22", "\x22\x5D", "\x6D\x61\x70", "\x61\x5B\x68\x72\x65\x66\x2A\x3D\x22", "\x74\x6F\x6B\x6F\x67\x61\x72\x75\x64\x61", "\x74\x6F\x6B\x6F\x77\x69\x6E\x64\x61", "\x62\x5F\x79\x6F\x6E\x64", "\x64\x65\x6E\x64\x6D\x61\x73", "\x5A\x41\x42\x68\x65\x61\x76\x79\x77\x61\x72\x72\x69\x6F\x72", "\x62\x6F\x73\x62\x65\x6E\x74\x6F", "\x72\x69\x64\x77\x61\x6E\x74\x61\x2E\x66", "\x70\x65\x6D\x62\x65\x6C\x61\x69\x73\x6C\x61\x6D", "\x6B\x61\x6D\x70\x75\x6E\x67\x70\x72\x69\x6E\x74\x65\x72", "\x66\x69\x74\x72\x61\x68\x31", "\x6E\x65\x77\x37", "\x6F\x6E\x73\x68\x6F\x70", "\x6F\x6E\x2E\x73\x68\x6F\x70", "\x6F\x6E\x70\x68\x6F\x6E\x73\x65\x6C", "\x2E\x61\x75\x74\x68\x6F\x72\x3E\x61\x3A\x61\x77\x61\x6C\x28", "\x29", "\x2E\x73\x75\x62\x2D\x6D\x65\x74\x61\x20\x2E\x66\x6E\x3A\x61\x77\x61\x6C\x28"];
	var _0xd28a = [_0x3df8[0], _0x3df8[1], _0x3df8[2], _0x3df8[3], _0x3df8[4], _0x3df8[5], _0x3df8[6], _0x3df8[7], _0x3df8[8], _0x3df8[9], _0x3df8[10], _0x3df8[11], _0x3df8[12], _0x3df8[13], _0x3df8[14], _0x3df8[15], _0x3df8[16], _0x3df8[17], _0x3df8[18], _0x3df8[19], _0x3df8[20], _0x3df8[21], _0x3df8[22], _0x3df8[23], _0x3df8[24], _0x3df8[25], _0x3df8[26], _0x3df8[27], _0x3df8[28], _0x3df8[29], _0x3df8[30], _0x3df8[31], _0x3df8[32], _0x3df8[33], _0x3df8[34], _0x3df8[35], _0x3df8[36], _0x3df8[37], _0x3df8[38], _0x3df8[39], _0x3df8[40], _0x3df8[41], _0x3df8[42], _0x3df8[43], _0x3df8[44], _0x3df8[45], _0x3df8[46], _0x3df8[47], _0x3df8[48], _0x3df8[49], _0x3df8[50], _0x3df8[51], _0x3df8[52], _0x3df8[53], _0x3df8[54], _0x3df8[55], _0x3df8[56], _0x3df8[57], _0x3df8[58], _0x3df8[59], _0x3df8[60], _0x3df8[61], _0x3df8[62], _0x3df8[63], _0x3df8[64], _0x3df8[65], _0x3df8[66], _0x3df8[67], _0x3df8[68], _0x3df8[69], _0x3df8[70], _0x3df8[71], _0x3df8[72], _0x3df8[73], _0x3df8[74]];
	var kakus = [_0xd28a[0], _0xd28a[1], _0xd28a[2], _0xd28a[3], _0xd28a[4], _0xd28a[5], _0xd28a[6], _0xd28a[7], _0xd28a[8], _0xd28a[9], _0xd28a[10], _0xd28a[11], _0xd28a[12], _0xd28a[13], _0xd28a[14], _0xd28a[15], _0xd28a[16], _0xd28a[17], _0xd28a[18], _0xd28a[19], _0xd28a[20], _0xd28a[21], _0xd28a[22], _0xd28a[23], _0xd28a[24], _0xd28a[25], _0xd28a[26], _0xd28a[27], _0xd28a[28], _0xd28a[29], _0xd28a[30], _0xd28a[31], _0xd28a[32], _0xd28a[33], _0xd28a[34], _0xd28a[35], _0xd28a[36], _0xd28a[37], _0xd28a[38], _0xd28a[39], _0xd28a[40], _0xd28a[41], _0xd28a[42], _0xd28a[43], _0xd28a[44], _0xd28a[45], _0xd28a[46], _0xd28a[47], _0xd28a[48], _0xd28a[49], _0xd28a[50], _0xd28a[51]],
		dQuery = $[_0xd28a[56]](kakus, function(_0x929ex4) {
			return _0xd28a[54] + _0x929ex4 + _0xd28a[55]
		})[_0xd28a[53]](_0xd28a[52]);
	mQuery = $[_0xd28a[56]](kakus, function(_0x929ex4) {
		return _0xd28a[57] + _0x929ex4 + _0xd28a[55]
	})[_0xd28a[53]](_0xd28a[52]);
	var kukus = [_0xd28a[58], _0xd28a[59], _0xd28a[60], _0xd28a[61], _0xd28a[62], _0xd28a[63], _0xd28a[64], _0xd28a[65], _0xd28a[66], _0xd28a[67], _0xd28a[68], _0xd28a[69], _0xd28a[70], _0xd28a[71]],
		dKuery = $[_0xd28a[56]](kukus, function(_0x929ex4) {
			return _0xd28a[72] + _0x929ex4 + _0xd28a[73]
		})[_0xd28a[53]](_0xd28a[52]);
	mKuery = $[_0xd28a[56]](kukus, function(_0x929ex4) {
		return _0xd28a[74] + _0x929ex4 + _0xd28a[73]
	})[_0xd28a[53]](_0xd28a[52]);

	if (window.location.href.indexOf("www.kaskus.co.id") > -1) {
		var hilang = $('.listing-table tbody tr:not(.sticky,.moved):has('+dQuery+')');
		var lenyap = $('.listing-table tbody tr:not(.sticky,.moved):has('+dKuery+')');
		var cuma = $('.listing-table tbody tr:not(.sticky,.moved):not(:has('+dQuery+'))');
		
		$('.post-entry>.listing-table').before('<div id="kotak-hilang" style="padding: 10px; clear: both;"> \
			<a id="show-iklan" class="btn btn-sm" style="background: #F7941D;color: #FFF;" href="javascript:void(0);" title="Show Iklan">Show All</a> \
			<a id="hide-iklan" class="btn btn-sm" style="background: #7CD168;color: #FFF;" href="javascript:void(0);" title="Hide Iklan">Hide Iklan</a> \
			<a id="only-iklan" class="btn btn-sm" style="background: #C365D1;color: #FFF;" href="javascript:void(0);" title="Only Iklan">Only Iklan</a> \
		</div>');
		$('.post-entry>.listing-table').after('<div id="kotak-hilang2" style="padding: 10px; clear: both;"> \
			<a id="show-iklan2" class="btn btn-sm" style="background: #F7941D;color: #FFF;" href="javascript:void(0);" title="Show Iklan">Show All</a> \
			<a id="hide-iklan2" class="btn btn-sm" style="background: #7CD168;color: #FFF;" href="javascript:void(0);" title="Hide Iklan">Hide Iklan</a> \
			<a id="only-iklan2" class="btn btn-sm" style="background: #C365D1;color: #FFF;" href="javascript:void(0);" title="Only Iklan">Only Iklan</a> \
		</div>');
	}
	if (window.location.href.indexOf("m.kaskus.co.id") > -1) {
		var hilang = $('.post-list > .list-entry:not(:has(.s)):has('+mQuery+')');
		var lenyap = $('.post-list > .list-entry:not(:has(.s)):has('+mKuery+')');
		var cuma = $('.post-list > .list-entry:not(:has(.s)):not(:has('+mKuery+'))');
		
		$('#main>#content-wrapper>.controls').after('<div id="kotak-hilang" style="padding: 10px; clear: both;"> \
			<a id="show-iklan" class="btn btn-sm" style="background: #F7941D;color: #FFF;" href="javascript:void(0);" title="Show Iklan">Show All</a> \
			<a id="hide-iklan" class="btn btn-sm" style="background: #7CD168;color: #FFF;" href="javascript:void(0);" title="Hide Iklan">Hide Iklan</a> \
			<a id="only-iklan" class="btn btn-sm" style="background: #C365D1;color: #FFF;" href="javascript:void(0);" title="Only Iklan">Only Iklan</a> \
		</div>');
		$('#main>#content-wrapper>.post-list>.controls').before('<div id="kotak-hilang2" style="padding: 10px; clear: both;"> \
			<a id="show-iklan2" class="btn btn-sm" style="background: #F7941D;color: #FFF;" href="javascript:void(0);" title="Show Iklan">Show All</a> \
			<a id="hide-iklan2" class="btn btn-sm" style="background: #7CD168;color: #FFF;" href="javascript:void(0);" title="Hide Iklan">Hide Iklan</a> \
			<a id="only-iklan2" class="btn btn-sm" style="background: #C365D1;color: #FFF;" href="javascript:void(0);" title="Only Iklan">Only Iklan</a> \
		</div>');
	}
		GM_addStyle('.hilang {display: none;}');
		GM_addStyle('.merah {color: red !important; }');
		hilang.addClass('merah').hide();
		lenyap.addClass('merah').hide();
		hilang.find('.link_thread_title').addClass('merah');
		lenyap.find('.link_thread_title').addClass('merah');
		$('#show-iklan, #show-iklan2').click(function(){
			cuma.show('slow');
			hilang.show('slow');
			lenyap.show('slow');
		});
		$('#hide-iklan, #hide-iklan2').click(function(){
			cuma.show('slow');
			hilang.hide('fast');
			lenyap.hide('fast');
		});
		$('#only-iklan, #only-iklan2').click(function(){
			cuma.hide('fast');
			hilang.show('slow');
			lenyap.show('slow');
		});
});

// 14/05/30 - AMZMA