User:WikiMacaroons/rev.js

if(window.location.href === "https://en.wikipedia.org/wiki/User:WikiMacaroons/C"){ var params = { action: "compare", format: "json", fromrev: 969974851, torev: 969976689 }, api = new mw.Api;

api.get( params ).done( function ( diff ) {	table = diff.compare["*"];	alert(table.toString);	document.getElementById('mw-content-text').innerHTML = table;	var diffin = table.indexOf("\"diff-addedline\"");	subd = table.substring(diffin + 17, table.length);	delCon;	tbs = table.toString;	var current = 0;	var going = 0;	var amount = 0;	while(going === 0){		if(tbs.includes("(UTC) ")){			//current = tbs.indexOf("(UTC)  ");			tbs = tbs.replace("(UTC)  ");			amount += 1;		}		else{			going = 1;		}	}	alert(amount); } ); } function delCon{ usestr = table.toString; var condiff = usestr.indexOf("\"diff-context\""); var fullstr = ""; currchar = condiff+20; var done = 0; while(done === 0){ men1 = currchar-1; men2 = currchar-2; men3 = currchar-3; men4 = currchar-4; men5 = currchar-5; if(usestr[currchar] === ">"){ if(usestr[men1] === "v" && usestr[men2] === "i" && usestr[men3] === "d" && usestr[men4] === "/" && usestr[men5] === "<"){ fullstr += usestr[currchar]; done = 1; }		}		else{ fullstr += usestr[currchar]; currchar+=1; }	}	alert(fullstr); alert(usestr.replace(" "+fullstr+" ", "")); }