User:Cblair91/wikia.js/checkuser.js

function checkUser(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.name == user)				return true;			else				return false;		}	}); } function findFakeUsers { indicator = stylepath + '/common/progress-wheel.gif'; output = "\n Userpage "; url = "/api.php?action=query&list=allpages&apnamespace=2&aplimit=5000&format=json"; if (!($('#fakeusersProgress').length)) $("#mw-fakeuses").prepend('  '); $.getJSON(url, function (data) {		if (data.query) {			pages = data.query.allpages;			for (page in pages)				if(checkUser(pages.title))					output += "\n \n " + pages.title + " ";			$("#mw-fakeusers").append(output);		}	}); } $(function {	if ($("#mw-fakeusers").length) {		findFakeUsers;	} else {		$('#fakeusersProgress').hide;	} });