User:Pcj/GlobalSearchForBlock.js

a = new mw.Api; var sites; var curWiki; function gNW(w){ curWiki = w;	wiki = sites.data.wikis[w]; if (wiki == undefined) return; fa = new mw.ForeignApi("//"+wiki.wiki_domain+"/api.php"); fa.get({action:"query",list:"blocks","bklimit":500}).done(function(data) {		var bFound = false;		if (data.query != undefined) {			for (b in data.query.blocks) {				block = data.query.blocks[b]; 				if (block == undefined) continue; 				if (block.user == undefined) {					bFound = true;					continue; 				}				if (block.user.indexOf("172.31")!=-1) bFound = true;			}			if (bFound) console.log(sites.data.wikis[curWiki].wiki_display_name+" https://"+sites.data.wikis[curWiki].wiki_domain+"/Special:Log/block");		}		gNW(curWiki+1);	}).fail(function(data){		gNW(curWiki+1);	}); } a.get({action:"allsites","do":"getSiteStats"}).done(function(data){ sites = data; gNW(0);});