User:Theleekycauldron/DYK credit finder.js

importScript('User:Theleekycauldron/Query pages.js'); try { var api = new mw.Api; } catch (SyntaxError) {}

function search(string) { var params = { action: 'query', list: 'search', srwhat: 'text', srnamespace: '3', srsearch: string, format: 'json' }	return api.get( params ).done(function ( data ) {		return data;	} ); } async function find_contrib_data(articles){ //	var contributors = {}; let searchres; let query; for (let article of articles){ contributors[article] = []; query = "insource:\"==DYK for ==\{\{ivmbox |image = Updated DYK query.svg\"".replace(" ",article); searchres = await search(query); for (let res of searchres.query.search){ if (!res.title.includes("/")){ // no hunting through archives contributors[article].push(res.title); }		}	}	return contributors; }