User:Frietjes/catargsnonarticles.js

/// Get non-articles in /// Category:Pages_using_duplicate_arguments_in_template_calls jQuery(document).ready(function($) { // //

if(mw.config.get('wgNamespaceNumber') != -1 ) { mw.loader.using(['mediawiki.util']).done( function {		var portletlink = mw.util.addPortletLink('p-tb', '#', 'Check cat args', 't-fdupna');		$(portletlink).click(function(e) { e.preventDefault; getNonArticles(0); });	}); }

function getNonArticles { var loopflag = true; var ckey; var plist = ""; var k = 0; var ns = "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|100|101|108" + "|109|118|119|446|447|710|711|828|829|2300|2301|2302|2303|2600";   var ignorelist = { "Template:Tlp/testcases":"1", "User:Monkbot/CS1 deprecated parameters (AWB)/testcases":"1", "User:Rjwilmsi/Test":"1", "User:Shearonink/basic sandbox":"1", "User:Trappist the monk/CS1 deprecated parameters: coauthor/testcases":"1", "User:Jonpatterns/templatesandbox":"1" };	ns = prompt("Namespaces",ns); while(loopflag) { k = k + 1; var req = new XMLHttpRequest; var cstr = ""; if(k > 1) { cstr = "&cmcontinue=" + ckey; }   	req.open("GET", wgScriptPath + "/api.php?format=json" +    		"&action=query&continue=" + cstr +     		"&list=categorymembers&cmlimit=500&cmtitle=" +     		"Category:Pages_using_duplicate_arguments_in_template_calls" +    		"&cmnamespace=" + ns, false); req.send(null); var response = eval("(" + req.responseText + ")").query.categorymembers; for(var index in response) { var info = response[index]; if( ignorelist[info.title] != "1") { if( info.title.search(/^User:/) >= 0 ) { plist = plist + info.title + "\n"; } else { plist = info.title + "\n" + plist; }   		}    	}    	if(eval("(" + req.responseText + ")").continue) { loopflag = true; ckey = eval("(" + req.responseText + ")").continue.cmcontinue; } else { loopflag = false; }	}	if( plist.length > 0 ) { alert(plist); } else { alert('Zero results!'); } } // //

});