Stream filter

SM live games name filter + balance->usd on site.

اعتبارا من 12-08-2015. شاهد أحدث إصدار.

// ==UserScript==
// @name                Stream filter
// @namespace           Hash G.
// @description         SM live games name filter + balance->usd on site.
// @include             *satoshimines.com*
// @require             http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @version             1.1
// @grant               GM_getValue
// @grant               GM_setValue
// @grant               GM_deleteValue
// @grant               GM_xmlhttpRequest
// ==/UserScript==

$(".menu").append("<li><a href='#' onClick='toggle()'>Toggle watching</a></li>");

function toggle() {
	var player = prompt("Player's name");
	var numberOfRows = $(".stream > tbody > tr").length;
	$(".stream").bind("DOMSubtreeModified", function() {
		$(".stream").find(".s_player").each(function () {
			$(this).find("span").each(function() {
				if ($(this).html() !== player) {
					$(this).parent().parent().remove();
				}
			});
		});
	});
}
exportFunction(toggle, unsafeWindow, {defineAs: "toggle"});


$(".balance > div:nth-child(1) > div:nth-child(1)").on("click", function (){
	var balance = $(".num").html();
	GM_xmlhttpRequest({
        method: "GET",
        url: "http://hashg.xyz/OMC-Rates/api.php?ref=hguscript",
        onload: function(response) {
			var responseText = response.responseText;
			var splittedResponse = responseText.split(":");
			btcAPI = splittedResponse[0] / 1000000;
			var usd = btcAPI * balance;
			alert("$" + usd.toFixed(3));
       }
    });
})