var firstNames = await fetch("https://gist.githubusercontent.com/elifiner/cc90fdd387449158829515782936a9a4/raw/e1a219c33d91b3eecb51ae7b5647d26ed667a11d/first-names.txt").then(r => r.text()).then(x => x.split('\n')); var lastNames = await fetch("https://gist.githubusercontent.com/elifiner/cc90fdd387449158829515782936a9a4/raw/e1a219c33d91b3eecb51ae7b5647d26ed667a11d/last-names.txt").then(r => r.text()).then(x => x.split('\n')); function generateRandomFullName() { const randomFirstName = firstNames[Math.floor(Math.random() * firstNames.length)]; const randomLastName = lastNames[Math.floor(Math.random() * lastNames.length)]; const fullName = `${randomFirstName} ${randomLastName}`; return fullName; } function getRandomPlatform() { var platforms = ["Android", "Chrome OS", "Chromium OS", "iOS", "Linux", "macOS", "Windows"]; return platforms[Math.floor(Math.random() * platforms.length)]; } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function getRandomUa() { const browsers = ['Chromium', 'Google Chrome', 'Mozilla Firefox', 'Safari']; const randomBrowser = browsers[getRandomInt(0, browsers.length - 1)]; const randomVersion = `v="${getRandomInt(75, 120)}"`; return `"${randomBrowser}";${randomVersion}`; } var bot = setInterval(function () { var voter = generateRandomFullName(); var voterFormatted = voter.split(" ").join("+"); var randomPlatform = getRandomPlatform(); var randomUa = getRandomUa(); var requestTime = new Date(); fetch("https://texashsfootball.com/wp-admin/admin-ajax.php", { "headers": { "accept": "application/json, text/javascript, */*; q=0.01", "accept-language": "en-US,en;q=0.9,fr;q=0.8,vi;q=0.7", "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "sec-ch-ua": `"${randomUa}"`, "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": `"${randomPlatform}"`, "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-requested-with": "XMLHttpRequest" }, "referrer": "https://texashsfootball.com/fan-vote-best-cheerleader-squad-championship/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "answer=8061&user-form-apm-name=${voterFormatted}&ays_finish_poll=e447edc1db&_wp_http_referer=%2Ffan-vote-best-cheerleader-squad-championship%2F&action=ays_finish_poll&poll_id=168&end_date=2024-01-06+09%3A36%3A09", "method": "POST", "mode": "cors", "credentials": "include" }).then(r => r.json()) .then(j => { //var ourTeam = t.answers.filter(x => x.id === 8061)[0].votes; //var theirTeam = t.answers.filter(x => x.id === 8062)[0].votes; console.log(`${j.answers[0].answer} ${j.answers[0].votes} | ${j.answers[1].answer} ${j.answers[1].votes}`); console.log(`Lead: ${j.answers[0].votes - j.answers[1].votes} | Server response time: ${(new Date() - requestTime) / 1000}`); }).catch(err => console.log(`Error in voting response`, err)); }, 500);