Loading...
More JavaScript Posts
//Use at https://mee6.xyz/leaderboard/732262089447702588//Higher the spammy stat, the more spammy that person is.//This is because mee doesn't give experience to people who post more comments in a minute.function statBlock(title, value){let elm = document.createElement("div");elm.className = "leaderboardPlayerStatBlock";let titleElm = document.createElement("div");titleElm.className = "leaderboardPlayerStatName";titleElm.textContent = title;let valueElm = document.createElement("div");valueElm.className = "leaderboardPlayerStatValue";valueElm.textContent = value;elm.appendChild(titleElm);elm.appendChild(valueElm);elm.remove = function(){this.parentElement.removeChild(this);}return elm;}for(let player of Array.from(document.getElementsByClassName("leaderboardPlayer"))){if(player.spamminess) player.spamminess.remove();let messages = null;let experience = null;const statBlockArray = Array.from(player.querySelectorAll(".leaderboardPlayerStatBlock"));for(let statBlock of statBlockArray){const statName = statBlock.querySelector(".leaderboardPlayerStatName").textContent;const text = statBlock.querySelector(".leaderboardPlayerStatValue").textContent;const number = ((text.includes("k"))? (text.replace("k","") * 1000.0) : +(text));if(statName.includes("MESSAGES")){messages = number;}else if(statName.includes("EXPERIENCE")){experience = number;}}const stats = player.querySelector(".leaderboardPlayerStats");const messagesElement = stats.firstChild;const spamminess = ((messages/experience)*2000.0).toFixed(2);player.spamminess = stats.insertBefore(statBlock("SPAMMINESS", spamminess), messagesElement);}
const linearSearch = (arr, item) => {for (const i in arr) {if (arr[i] === item) return +i;}return -1;};linearSearch([2, 9, 9], 9); // 1linearSearch([2, 9, 9], 7); // -1
alert("bruh")
const getURLParameters = url =>(url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce((a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a),{});
const countSubstrings = (str, searchValue) => {let count = 0,i = 0;while (true) {const r = str.indexOf(searchValue, i);if (r !== -1) [count, i] = [count + 1, r + 1];else return count;}};countSubstrings('tiktok tok tok tik tok tik', 'tik'); // 3countSubstrings('tutut tut tut', 'tut'); // 4
//Upvotes comments according to a regex pattern. I tried it out on https://www.reddit.com/r/VALORANT/comments/ne74n4/please_admire_this_clip_precise_gunplay_btw///Known bugs://If a comment was already upvoted, it gets downvoted//For some reason, it has around a 50-70% success rate. The case insensitive bit works, but I think some of the query selector stuff gets changed. Still, 50% is goodlet comments = document.getElementsByClassName("_3tw__eCCe7j-epNCKGXUKk"); //Comment classlet commentsToUpvote = [];const regexToMatch = /wtf/gi;for(let comment of comments){let text = comment.querySelector("._1qeIAgB0cPwnLhDF9XSiJM"); //Comment content classif(text == undefined){continue;}text = text.textContent;if(regexToMatch.test(text)){console.log(text);commentsToUpvote.push(comment);}}function upvote(comment){console.log(comment.querySelector(".icon-upvote")); //Just showing you what it's doingcomment.querySelector(".icon-upvote").click();}function slowRecurse(){let comment = commentsToUpvote.pop(); //It's gonna go bottom to top but whateverif(comment != undefined){upvote(comment);setTimeout(slowRecurse,500);}}slowRecurse();