User:Majr/getOrphanTalkPages.js

Promise.resolve( mw.loader.using( 'mediawiki.api' ) ).then( async => {	'use strict';	let api = new mw.Api;	let params = {		action: 'query',		generator: 'allpages',		gaplimit: 'max',		gapfilterredir: 'all',		prop: 'info',		inprop: 'subjectid',		formatversion: 2,	};	let orphans = [];	for ( let num of [ 1, 5, 7, 9, 11, 13, 15, 275, 829, 2301, 2303 ] ) {		params.gapnamespace = num;		let cont;		while( true ) {			$.extend( params, cont );			let data = await api.get( params );			data.query && data.query.pages.forEach( page => { !page.subjectid && page.title.search( /\/Archive/ ) < 0 && orphans.push( page.title ); } );			cont = data.continue;			if ( !cont ) {				break;			}		}	}	console.log( '* ' + orphans.join( '\n* ' ) + '' ); } );