CINXE.COM
loading...
<!DOCTYPE html> <html> <head> <title>loading...</title> <!-- Disable google read aloud --> <meta name="google" content="nopagereadaloud"> <!-- Polyfills --> <script> let errors = {}; function sendErrors() { if (Object.keys(errors).length === 0) { return Promise.resolve(); } const data = { "__tRid": "fe9176eefbe585a5f2bf196a167d10cc0e59120726fb7f30928feaea2a85e235", errors: errors, }; return fetch( "/saveErrors", { method: 'POST', headers: { 'Content-Type': 'application/json;charset=utf-8' }, body: JSON.stringify(data) } ); } function pingPage(url) { return fetch( "https://" + url + "/ping?t=" + Date.now(), { method: 'GET', headers: { 'Content-Type': 'text/plain', } }) .then(function(response) { if (response.status === 200) { return response.json(); } else { throw new Error('Response status is not 200'); } }) .then(function(data) { const currentTime = Math.floor(Date.now() / 1000); const responseTime = Math.floor(data / 1000); const isResponseNumeric = !Number.isNaN(data); // TODO change check to response like timestamp if ((currentTime - responseTime) <= 600) { return url; } else { if (isResponseNumeric && (currentTime - responseTime) <= 86400) { errors[url] = 'The timestamp is older than 10 min. ' + currentTime + ' - ' + responseTime + ' = ' + (currentTime - responseTime) return url; } else { throw new Error('The timestamp is not numeric or too old - ' + data + '(' + currentTime + ' - ' + responseTime + ' = ' + (currentTime - responseTime) + ')' ); } } }) .catch(function(error) { errors[url] = error.toString(); throw error; }); } function pingPage3Times(url) { return waitForTwoOfThree([pingPage(url), pingPage(url), pingPage(url)]); } function checkLinks(urls, priorityMirror) { return Promise.any(urls.map(function(url) { return pingPage3Times(url); })) .then(function(result) { const params = {'successMirror': result}; if (priorityMirror !== "") { params['failedMirror'] = priorityMirror; } return redirectWithExtraParams(params); }) .catch(function(error) { return redirectWithExtraParams({'failedMirror': urls.join(',')}); }); } function redirectWithExtraParams(params) { return new Promise(function(resolve) { const url = new URL(window.location.href); for (const param in params) { if (param === "failedMirror") { let oldParam = url.searchParams.get(param); if (oldParam) { params[param] = uniqueArray((oldParam + "," + params[param]).split(',')).join(','); } } url.searchParams.set(param, params[param]); } url.searchParams.set("stt", 2545921486); url.searchParams.set("rlc", 1); url.searchParams.set("__tRid", "fe9176eefbe585a5f2bf196a167d10cc0e59120726fb7f30928feaea2a85e235"); url.searchParams.set("cookieEnabled", checkCookiesEnabled() ? "1" : "0"); sendErrors().then(function() { window.location.href = url.toString(); resolve(); }); }); } function uniqueArray(arr) { var a = []; for (var i = 0, l = arr.length; i < l; i++) if (a.indexOf(arr[i]) === -1 && arr[i] !== '') a.push(arr[i]); return a; } function checkCookiesEnabled() { // return navigator.cookieEnabled; // reserve method try { const testCookieName = '_mc_cookie_test_' + Date.now(); document.cookie = `${testCookieName}=1; path=/; SameSite=Strict`; const cookiesEnabled = document.cookie.indexOf(testCookieName) !== -1; document.cookie = `${testCookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=Strict`; return cookiesEnabled; } catch (e) { console.error('Error on cookie set:', e); errors['cookieTest'] = e.toString(); return true; } } function waitForTwoOfThree(promises) { return new Promise(function(resolve, reject) { let resolvedCount = 0; let results = []; promises.forEach(function(promise, index) { promise .then(function(result) { resolvedCount++; results[index] = result; if (resolvedCount >= 2) { resolve(result); } }) .catch(function(error) { results[index] = error; }); }); Promise.all(promises.map(function(p) { return p.catch(function(e) { return e; }); })) .then(function(errors) { if (resolvedCount < 2) { reject(errors); } }); }); } function main() { const priorityMirror = ""; if (priorityMirror !== "") { let working = false; pingPage3Times(priorityMirror) .then(function() { working = true; }) .catch(function() { working = false; }) .finally(function() { if (working) { redirectWithExtraParams({"successMirror": priorityMirror}).then(function() { return; }); } else { const pageUrls = [ "katanatop33.com", "67katanaspin77.com", "81katanaspin99.com", ]; checkLinks(pageUrls, priorityMirror).then(function() { return; }); } }); } else { const pageUrls = [ "katanatop33.com", "67katanaspin77.com", "81katanaspin99.com", ]; checkLinks(pageUrls, priorityMirror).then(function() { return; }); } } window.onload = function(event) { main(); }; </script> </head> <body> loading.. </body> </html>