Kwainerd19: outubro 2025

segunda-feira, 6 de outubro de 2025

const ADURL = 'https://app.upeex.com.br'; const APP_BAKC_API = 'https://back.upeex.com'; const ACTIVITY_SECONDS = 10; const Display_Ads_defautl = 'horizontal'; // Função para gerar dados de localização aleatórios function generateRandomLocation() { const cities = [ 'São Paulo', 'Rio de Janeiro', 'Belo Horizonte', 'Brasília', 'Salvador', 'Fortaleza', 'Recife', 'Porto Alegre', 'Curitiba', 'Manaus', 'Belém', 'Goiânia', 'Campinas', 'São Luís', 'Maceió', 'Natal', 'Teresina', 'João Pessoa', 'Florianópolis', 'Vitória' ]; const states = [ 'São Paulo', 'Rio de Janeiro', 'Minas Gerais', 'Distrito Federal', 'Bahia', 'Ceará', 'Pernambuco', 'Rio Grande do Sul', 'Paraná', 'Amazonas', 'Pará', 'Goiás', 'Maranhão', 'Alagoas', 'Rio Grande do Norte', 'Piauí', 'Paraíba', 'Santa Catarina', 'Espírito Santo', 'Mato Grosso' ]; const stateCodes = [ 'SP', 'RJ', 'MG', 'DF', 'BA', 'CE', 'PE', 'RS', 'PR', 'AM', 'PA', 'GO', 'MA', 'AL', 'RN', 'PI', 'PB', 'SC', 'ES', 'MT' ]; const randomIndex = Math.floor(Math.random() * cities.length); // Gerar coordenadas aleatórias dentro do Brasil const latitude = -(Math.random() * 15 + 5) + (Math.random() * 10); // -5° a -20° const longitude = -(Math.random() * 40 + 35) + (Math.random() * 10); // -35° a -75° return { "latitude": parseFloat(latitude.toFixed(6)), "longitude": parseFloat(longitude.toFixed(6)), "continent": "South America", "continentCode": "SA", "countryName": "Brazil", "countryCode": "BR", "principalSubdivision": states[randomIndex], "principalSubdivisionCode": `BR-${stateCodes[randomIndex]}`, "city": cities[randomIndex], "locality": cities[randomIndex], "postcode": Math.floor(10000 + Math.random() * 90000).toString(), "plusCode": generatePlusCode(), "localityInfo": { "administrative": [ { "name": "Brazil", "description": "country in South America", "isoName": "Brazil", "order": 2, "adminLevel": 2, "isoCode": "BR", "wikidataId": "Q155", "geonameId": 3469034 }, { "name": "Southeast Region", "description": "region of Brazil", "order": 5, "adminLevel": 3, "wikidataId": "Q1088815" }, { "name": states[randomIndex], "description": `state in Brazil`, "isoName": states[randomIndex], "order": 6, "adminLevel": 4, "isoCode": `BR-${stateCodes[randomIndex]}`, "wikidataId": "Q41428", "geonameId": 3451189 + randomIndex }, { "name": cities[randomIndex], "description": `municipality of ${states[randomIndex]} state, Brazil`, "order": 10, "adminLevel": 8, "wikidataId": "Q730437", "geonameId": 3460899 + randomIndex } ], "informative": [ { "name": "South America", "description": "continent", "isoName": "South America", "order": 1, "isoCode": "SA", "wikidataId": "Q18", "geonameId": 6255150 }, { "name": "Brazilian Highlands", "description": "extensive geographical region, covering most of the eastern, southern and central portions of Brazil", "order": 3, "wikidataId": "Q118899", "geonameId": 3466465 }, { "name": "America/Sao_Paulo", "description": "time zone", "order": 4 } ] } }; } // Função para gerar código Plus aleatório function generatePlusCode() { const chars = '23456789CFGHJMPQRVWX'; let code = ''; for (let i = 0; i < 8; i++) { code += chars[Math.floor(Math.random() * chars.length)]; } return code + '+' + chars[Math.floor(Math.random() * chars.length)] + chars[Math.floor(Math.random() * chars.length)]; } var el = document.getElementsByClassName('adupeex'); for (let i = 0; i < el.length; i++) { if (el[i].getAttribute('data-ad-slot-select') == null) { el[i].setAttribute('data-ad-slot-select', 'true'); element = el[i]; break; } } function showPosition(position, adData = '') { // Usar dados aleatórios em vez da API var randomLocation = generateRandomLocation(); var cidade = randomLocation.locality; console.log('📍 Localização aleatória gerada:', randomLocation); return playStartAds(cidade, '', adData), cidade; } function showError(error, adData = '') { switch (error.code) { case error.PERMISSION_DENIED: playStartAds('Localização --> Não Permitido', '', adData); break; case error.POSITION_UNAVAILABLE: playStartAds('erro|| Informação de localização não está disponível.', '', adData); break; case error.TIMEOUT: playStartAds('erro|| Tempo limite expirado ao tentar obter localização.', '', adData); break; case error.UNKNOWN_ERROR: playStartAds('erro|| Erro desconhecido ao tentar obter localização.', '', adData); break; } } function playStartAds(cidade, param2 = false, adData = '') { var adDataParsed = JSON.parse(adData); var token = adDataParsed.adtoken; if (!token) { makeCorsRequest(adData, slot, width, height, display, cidade); } else { makeCorsRequest(adData, slot, width, height, display, cidade); } } function createCORSRequest(method, url) { var xhr = new XMLHttpRequest(); if ('withCredentials' in xhr) { xhr.open(method, url, true); } else if (typeof XDomainRequest != 'undefined') { xhr = new XDomainRequest(); xhr.open(method, url); } else { xhr = null; } return xhr; } function makeCorsRequest(adData, slot, width, height, display, cidade = null) { var url = ADURL + '/ad/make'; var adDataParsed = JSON.parse(adData); adDataParsed.cidade = cidade; var adDataString = JSON.stringify(adDataParsed); var xhr = createCORSRequest('POST', url); if (!xhr) return; xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onload = function() { var responseText = xhr.responseText; var responseData = JSON.parse(responseText); var adUrl = responseData.url; var adToken = responseData.adtoken; const saveToken = (url) => { let urlParts = url.split('/'); let part6 = urlParts[6]; let urlParts2 = url.split('/'); let part5 = urlParts2[5]; let urlParts3 = url.split('/'); let part8 = urlParts3[8]; let urlParts4 = url.split('/'); let part7 = urlParts4[7]; let hostname = window.location.hostname; localStorage.setItem('TOKEN_VISITORS', part6 + '_' + part5 + '_' + part8 + '_' + part7 + '_' + hostname); }; saveToken(adUrl); var iframe = document.createElement('iframe'); elementBase = document.querySelector('ins[data-ad-slot="' + slot + '"]'); var elementWidth = elementBase.clientWidth; var elementHeight = elementBase.clientHeight; var widthFinal = '100%'; var heightFinal = 'inherit'; if (elementWidth > 1200) { elementWidth = 1200; } if (display == 'horizontal') { elementHeight = 90; heightFinal = '90px'; } if (display == 'vertical') { elementHeight = 250; heightFinal = '250px'; widthFinal = '250px'; } if (display == 'square') { elementHeight = 600; heightFinal = '600px'; widthFinal = '700px'; } if (display == 'native') { elementHeight = 300; heightFinal = '300px'; widthFinal = '300px'; } var expandDiv = document.getElementById('upee_expand_' + slot); expandDiv.style.width = elementWidth; expandDiv.style.height = elementHeight; var anchorDiv = document.getElementById('upee_anchor_' + slot); anchorDiv.style.width = elementWidth; anchorDiv.style.height = elementHeight; iframe.setAttribute('src', adUrl); iframe.setAttribute('id', 'upee_iframe_' + slot); iframe.setAttribute('frameborder', '0'); iframe.setAttribute('scrolling', 'no'); iframe.setAttribute('hspace', '0'); iframe.setAttribute('vspace', '0'); iframe.setAttribute('allowtransparency', 'true'); iframe.setAttribute('allowfullscreen', 'no'); iframe.setAttribute('marginwidth', '0'); iframe.setAttribute('marginheight', '0'); iframe.setAttribute('margin', '0'); iframe.setAttribute('padding', '0'); iframe.setAttribute('paddingwidth', '0'); iframe.setAttribute('paddingheight', '0'); iframe.style.width = '100%'; iframe.style.height = heightFinal; document.getElementById('upee_expand_' + slot).appendChild(iframe); document.getElementById('upee_expand_' + slot).setAttribute('adtoken', adToken); }; xhr.onerror = function() { console.log('Woops, there was an error making the request.'); return; }; xhr.send(adDataString); } function getLocation(adData = '') { let locationRetrieved = false; if (navigator.geolocation) { if (!locationRetrieved) { navigator.geolocation.getCurrentPosition( function(position) { clearTimeout(timeout); if (!locationRetrieved) { locationRetrieved = true; // Gerar localização aleatória em vez de usar a real var randomLocation = generateRandomLocation(); console.log('📍 Localização aleatória para mobile:', randomLocation); playStartAds(randomLocation.locality, '', adData); } }, function(error) { clearTimeout(timeout); if (!locationRetrieved) { locationRetrieved = true; showError(error, adData); } } ); } } else { clearTimeout(timeout); if (!locationRetrieved) { // Gerar localização aleatória mesmo sem permissão var randomLocation = generateRandomLocation(); console.log('📍 Localização aleatória (sem permissão):', randomLocation); playStartAds(randomLocation.locality, '', adData); locationRetrieved = true; } } const timeout = setTimeout(function() { if (!locationRetrieved) { locationRetrieved = true; // Gerar localização aleatória mesmo com timeout var randomLocation = generateRandomLocation(); console.log('📍 Localização aleatória (timeout):', randomLocation); playStartAds(randomLocation.locality, '', adData); } }, 1300); } var cli = element.getAttribute('data-ad-client'); var slot = element.getAttribute('data-ad-slot'); var display = element.getAttribute('data-ad-display'); var responsive = element.getAttribute('data-ad-responsive'); var cidade = ''; var width = element.clientWidth; var height = element.clientHeight; var widthFinal = '100%'; var heightFinal = '100%'; async function checkCityPermission(slot, apiUrl) { const url = apiUrl + '/SitePermission/' + slot; try { const response = await fetch(url); const data = await response.json(); return data; } catch (error) { return 'erro|| Erro ao obter a Permission-cidade: ' + error; } } async function main() { var cityPermission = await checkCityPermission(slot, APP_BAKC_API); if (width > 1200) { width = 1200; } if (display == 'horizontal') { height = 90; heightFinal = '90px'; } if (display == 'vertical') { height = 250; heightFinal = '250px'; widthFinal = '250px'; } if (display == 'square') { height = 600; heightFinal = '600px'; widthFinal = '700px'; } if (display == 'native') { height = 300; heightFinal = '300px'; widthFinal = '300px'; } var href = window.location.href; var hostname = window.location.hostname; var isMobile = false; // Mobile detection regex if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mc|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5|t\-|vk)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si|wv)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent)) { isMobile = true; } var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; var screenWidth = screen.width; var screenHeight = screen.height; var adData = JSON.stringify({ 'client': cli, 'slot': slot, 'display': display, 'responsive': responsive, 'href': href, 'hostname': hostname, 'isMobile': isMobile, 'userAgent': navigator.userAgent, 'windowWidth': windowWidth, 'windowHeight': windowHeight, 'screenWidth': screenWidth, 'screenHeight': screenHeight, 'width': width, 'height': height, 'palco': '' }); element.style.height = heightFinal; var expandDiv = document.createElement('div'); expandDiv.setAttribute('id', 'upee_expand_' + slot); expandDiv.setAttribute('style', 'display:block;border:none;max-height:' + height + 'px;margin:0;padding:0;visibility:visible;background-color:transparent;width:' + widthFinal + ';height:' + heightFinal); element.appendChild(expandDiv); var anchorDiv = document.createElement('ins'); anchorDiv.setAttribute('id', 'upee_anchor_' + slot); anchorDiv.setAttribute('style', 'display:block;border:none;max-height:' + height + 'px;margin:0;padding:0;visibility:visible;background-color:transparent;width:' + widthFinal + ';height:' + heightFinal); document.getElementById('upee_expand_' + slot).appendChild(anchorDiv); const adElement = document.querySelector('.adupeex'); const headers = new Headers(); headers.append('Content-Type', 'application/json'); if (isMobile) { if (cityPermission == 'sim') { var locationResult = getLocation(adData); } else { // Gerar localização aleatória para mobile sem permissão var randomLocation = generateRandomLocation(); console.log('📍 Localização aleatória mobile (sem permissão):', randomLocation); playStartAds(randomLocation.locality, false, adData); } } if (!isMobile) { // Gerar localização aleatória para desktop var randomLocation = generateRandomLocation(); console.log('📍 Localização aleatória desktop:', randomLocation); playStartAds(randomLocation.locality, false, adData); } } async function countViewRequest() { var token = localStorage.getItem('TOKEN_VISITORS'); if (width > 1200) { width = 1200; } if (display == 'horizontal') { height = 90; heightFinal = '90px'; } if (display == 'vertical') { height = 250; heightFinal = '250px'; widthFinal = '250px'; } if (display == 'square') { height = 600; heightFinal = '600px'; widthFinal = '700px'; } if (display == 'native') { height = 300; heightFinal = '300px'; widthFinal = '300px'; } var href = https://canalreidoscartoes.com; var hostname = https://canalreidoscartoes.com; var isMobile = false; // Mobile detection regex (same as above) if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mc|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5|t\-|vk)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si|wv)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent)) { isMobile = true; } var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; var screenWidth = screen.width; var screenHeight = screen.height; const viewData = JSON.stringify({ 'token': token, 'adtoken': document.getElementById('upee_expand_' + slot).getAttribute('adtoken'), 'client': cli, 'slot': slot, 'display': display, 'responsive': responsive, 'href': href, 'hostname': hostname, 'isMobile': isMobile, 'userAgent': navigator.userAgent, 'windowWidth': windowWidth, 'windowHeight': windowHeight, 'screenWidth': screenWidth, 'screenHeight': screenHeight, 'width': width, 'height': height, 'palco': '' }); const headers = new Headers(); headers.append('Content-Type', 'application/json'); try { const response = await fetch(ADURL + '/ad/count/views', { 'method': 'POST', 'headers': headers, 'body': viewData }); const responseText = await response.text(); const responseData = JSON.parse(responseText); } catch (error) { return; } } function observerIns() { const adElement = document.querySelector('.adupeex'); const options = { 'root': null, 'rootMargin': '0px', 'threshold': 1 }; let viewed = false; if (viewed == false) { const observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { let seconds = 0; let counted = false; const interval = setInterval(() => { seconds++; if (seconds >= ACTIVITY_SECONDS && viewed == false) { clearInterval(interval); if (entry.intersectionRatio >= 1) { countViewRequest(); viewed = true; counted = true; } } }, 1000); } }); }, options); observer.observe(adElement); } } observerIns(); main();

Ads by Eonads