User:Cblair91/wikia.js/checkuser.js

function checkUser(user) { user = user.replace("User:", ""); if(user.indexOf("/") != -1) { getName = user.split("/"); user = getName[0]; }	$.getJSON("/api.php?action=query&list=allusers&aulimit=1&format=json&aufrom=" + user, function(data) {		if(data.query) {			if(data.query.allusers[0].name != user) {				console.log("User doesn't exist: " + user)				$("#checkusers").append("\n \n User:" + user + " ");			}		} else			alert("BOOM!");	}); } function findFakeUsers { indicator = stylepath + '/common/progress-wheel.gif'; url = "/api.php?action=query&list=allpages&apnamespace=2&aplimit=5000&format=json"; if (!($('#fakeusersProgress').length)) $("#mw-fakeusers").prepend('  '); $.getJSON(url, function (data) {		if (data.query) {			$("#mw-fakeusers").append("\n Userpage ");			pages = data.query.allpages;			for (page in pages)				checkUser(pages[page].title)			$("#mw-fakeusers").append(output);		}	}); } $(function {	if ($("#mw-fakeusers").length) {		findFakeUsers;	} else {		$('#fakeusersProgress').hide;	} });