const parichki_host = "api.parichki.net"; const parichki_user_ip = "18.205.189.114"; function Fingerprint(hasher){ var nativeForEach = Array.prototype.forEach; var nativeMap = Array.prototype.map; this.each = function(obj, iterator, context) { if (obj == null) return; if (nativeForEach && obj.forEach === nativeForEach) { obj.forEach(iterator, context); } else if (obj.length === +obj.length) { for (var i = 0, l = obj.length; i < l; i++) { if (iterator.call(context, obj[i], i, obj) === {}) return; } } else { for (var key in obj) { if (obj.hasOwnProperty(key)) { if (iterator.call(context, obj[key], key, obj) === {}) return; } } } }; this.map = function(obj, iterator, context) { var results = []; if (obj == null) return results; if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); this.each(obj, function(value, index, list) { results[results.length] = iterator.call(context, value, index, list); }); return results; }; if(hasher){ this.hasher = hasher; } } Fingerprint.prototype = { get: function(){ keys = []; keys.push(navigator.userAgent); keys.push([screen.height, screen.width, screen.colorDepth].join('x')); keys.push(new Date().getTimezoneOffset()); // keys.push(!!window.sessionStorage); // keys.push(!!window.localStorage); var pluginsString = this.map(navigator.plugins, function(p){ var mimeTypes = this.map(p, function(mt){ return [mt.type, mt.suffixes].join('~'); }).join(','); return [p.name, p.description, mimeTypes].join('::'); }, this).join(';'); keys.push(pluginsString); if(this.hasher){ return this.hasher(keys.join('###'), 31); } else { return this.murmurhash3_32_gc(keys.join('###'), 31); } }, murmurhash3_32_gc: function(key, seed) { var remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i; remainder = key.length & 3; // key.length % 4 bytes = key.length - remainder; h1 = seed; c1 = 0xcc9e2d51; c2 = 0x1b873593; i = 0; while (i < bytes) { k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(++i) & 0xff) << 8) | ((key.charCodeAt(++i) & 0xff) << 16) | ((key.charCodeAt(++i) & 0xff) << 24); ++i; k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff; h1 ^= k1; h1 = (h1 << 13) | (h1 >>> 19); h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff; h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16)); } k1 = 0; switch (remainder) { case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; case 1: k1 ^= (key.charCodeAt(i) & 0xff); k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff; h1 ^= k1; } h1 ^= key.length; h1 ^= h1 >>> 16; h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff; h1 ^= h1 >>> 13; h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff; h1 ^= h1 >>> 16; return h1 >>> 0; } } const fingerprint = new Fingerprint().get(); const parichki_userUniqueId = parichki_user_ip + '===' + fingerprint; var parichki_user_is_active = true; const parichki_ref_domain = extractDomain(document.referrer); var parichki_on_blur_message = 'Излязохте от прозореца. Кликнете на прозореца/таба за да се върнете.'; var parichki_current_message = ''; var parichki_current_task = null; var additional_time = 0; var socket; var window_started_load_new_page = 0; $ = jQuery; function extractDomain(url) { var domain; //find & remove protocol (http, ftp, etc.) and get domain if (url.indexOf("://") > -1) { domain = url.split('/')[2]; } else { domain = url.split('/')[0]; } //find & remove www if (domain.indexOf("www.") > -1) { domain = domain.split('www.')[1]; } domain = domain.split(':')[0]; domain = domain.split('?')[0]; return domain; } function getCookied(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(";"); for(let i = 0; i '+data['stay']+' секунди'); var par_currentsecondsstate = data['stay'] var par_interval = setInterval(function (){ if (parichki_user_is_active != true){ } else { if (par_currentsecondsstate == 0) { $("#parichki_top_line").addClass("loading"); $("#parichki_top_line").find("#parichki_task").html(''); const currentDate = new Date(); const timestamp = currentDate.getTime(); $("#parichki_top_line").css({"background-image":'url(https://parichki.net/app/assets/parichki-icon.svg?v='+timestamp+')'}); $("#parichki_top_line").find("#parichki_task").html('...'); $("#parichki_top_line").show(); parichki_socket.send(JSON.stringify({ 'type': 'task_tracker', 'action': 'next_step', 'refer_url': document.referrer, 'refer': parichki_ref_domain, 'url': window.location.href, 'user_ip': parichki_user_ip, 'user_fp': fingerprint, 'taskID':data['taskID'], 'domain': extractDomain(window.location.href) })); clearInterval(par_interval); } else { par_currentsecondsstate = par_currentsecondsstate - 1; $(".parichki_timerseconds").text(par_currentsecondsstate); } } },1000); } else if (data['type'] == 'start_next_step'){ parichki_socket.send(JSON.stringify({ 'type': 'task_tracker', 'action': 'start_tracking', 'refer_url': document.referrer, 'refer': parichki_ref_domain, 'url': window.location.href, 'user_ip': parichki_user_ip, 'user_fp': fingerprint, 'domain': extractDomain(window.location.href) })); } else if (data['type'] == "click_on_link"){ frontend_alert(data['text']); } else if (data['type'] == "click_on_element"){ frontend_alert(data['text']); $(document).delegate(data['element'],"click",function (е){ var element_data = new Object(); element_data['url'] = $(this).attr("href"); element_data['text'] = $(this).text(); element_data['element_classes'] = $(this).attr("class"); if (typeof (data['element_url']) !== 'undefined'){ if (element_data['url'] == data['element_url']){ parichki_socket.send(JSON.stringify({ 'type': 'task_tracker', 'action': 'clicked_on_element', 'element_data': element_data, 'refer_url': document.referrer, 'refer': parichki_ref_domain, 'url': window.location.href, 'user_ip': parichki_user_ip, 'user_fp': fingerprint, 'domain': extractDomain(window.location.href) })); } else { е.preventDefault(); alert("Кликнахте на грешен линк!"); } } else { var ouhjshdaj = { 'type': 'task_tracker', 'action': 'clicked_on_element', 'element_data': element_data, 'refer_url': document.referrer, 'refer': parichki_ref_domain, 'url': window.location.href, 'user_ip': parichki_user_ip, 'user_fp': fingerprint, 'domain': extractDomain(window.location.href) }; parichki_socket.send(JSON.stringify(ouhjshdaj)); } }); } else if (data['type'] == "task_completed"){ frontend_alert(data['text']); $("#parichki_task").html(data['text']); $("#parichki_top_line").addClass("parichki_success"); document.cookie = 'task_started=; Max-Age=0; path=/; SameSite=None; domain=parichki.net'; alert(data['text']); } } const parichki_socket = new WebSocket('wss://socket.parichki.net/user/'+parichki_userUniqueId); parichki_socket.onmessage = function (e) { var data = JSON.parse(e.data); $(".the_content").find("a").each(function (){ if ($(this).attr("class") == '' || typeof $(this).attr("class") == 'undefined'){ var thiscrlink = $(this).attr("href"); if (thiscrlink.includes("/go/") || thiscrlink.includes("youtube.com")){ } else { $(this).addClass("internallinktext"); } } }); $("#article-contents-sc").find(".internallinktext").each(function (){ $(this).removeClass(); }); $("#article-contents").find(".internallinktext").each(function (){ $(this).removeClass(); }); if (data['type'] == 'establish'){ start_tracking(data['task']); } else if (data['type'] == 'bridge'){ bridge(data['data']); } }; parichki_socket.onopen = function (e) { window.onbeforeunload = function () { $("#parichki_top_line").hide(); $("#parichki_top_line").find("#parichki_task").html('...'); $("#parichki_top_line").show(); window_started_load_new_page = 1; } parichki_user_is_active = true; window.addEventListener('focus', function () { $("#parichki_task").html(parichki_current_message); parichki_user_is_active = true; }); window.addEventListener('blur', function () { parichki_current_message = $("#parichki_task").html(); if (parichki_current_message != '') { $("#parichki_task").html('' + parichki_on_blur_message + ''); parichki_user_is_active = false; if ($(document).find('.iframecontainer').length > 0) { if (parichki_current_message != '') { $("#parichki_task").html(parichki_current_message); } parichki_user_is_active = true; } } }); }; parichki_socket.onclose = function (e) {}; function frontend_alert(text){ if ($("#parichki_top_line").length <= 0){ $("body").append("
"); var styleHTML = ` `; $("body").append(styleHTML); } const currentDate = new Date(); const timestamp = currentDate.getTime(); if (window_started_load_new_page == 1){ $("#parichki_top_line").hide(); $("#parichki_top_line").addClass("loading"); $("#parichki_top_line").css({"background-image":'url(https://parichki.net/app/assets/parichki-icon.svg?v='+timestamp+')'}); $("#parichki_top_line").find("#parichki_task").html('...'); $("#parichki_top_line").show(); } else { $("#parichki_top_line").hide(); $("#parichki_top_line").addClass("loading"); $("#parichki_top_line").find("#parichki_task").html(text); setTimeout(function (){ $("#parichki_top_line").removeClass("loading"); $("#parichki_top_line").css({"background-image":'url(https://parichki.net/app/assets/parichki-icon.svg?v='+timestamp+')'}); $("#parichki_top_line").show(); },150); } } // var callback_iframe = function(){ // document.body.innerHTML += ""; // setTimeout(function (){ // console.log(document.getElementById("parichki-iframe").contentWindow.document); // console.log('---cookie-iframe----'+document.getElementById("parichki-iframe").contentWindow.document.cookie); // },2550); // }; // // if ( // document.readyState === "complete" || // (document.readyState !== "loading" && !document.documentElement.doScroll) // ) { // callback_iframe(); // } else { // document.addEventListener("DOMContentLoaded", callback_iframe); // }