$(function () { setTimeout("$_statnew.onstat()", 10000); console.log("stat load"); }); var $_statnew = new (function () { var state = false; this.onstat = function (n) { if (!state) { state = true; console.log("stat invoke"); var ccname = encodeURIComponent(location.href); if (this.gcc(ccname) == "1") { console.log("stat ignore"); return; } this.scc(ccname, "1"); try { var ms = location.hash.match(new RegExp('token=([^&|#]*)')); $.ajax({ url: "//twstat.17sex.me/stat/in", data: { ds: screen.width + "," + screen.height, ref: (document.referrer ? document.referrer : ""), hash: ms != null ? ms[1] : "", arturl: location.href }, cache: false, dataType: "script" }); } catch (e) { console.log(e); } } };this.scc = function (name, value) { var exp = new Date(); exp.setTime(exp.getTime() + 24 * 60 * 60 * 1000); document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/"; };this.gcc = function (name) { var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); if (arr != null) return unescape(arr[2]); return null; } })();