User:Chlod/Topic/Marcos
Appearance
This is a list of pages under the Marcos family category, updated based on PetScan. Instances of revisionism may run rife in these articles. To watch all of these pages, use Special:RelatedChanges.
Pages
[edit]Gathering
[edit]To update, run the following in your browser console.
( async function() {
const scannedPages = await fetch("https://petscan.wmflabs.org/", {
"referrer": "https://petscan.wmflabs.org/",
"body": new URLSearchParams({"language":"en","project":"wikipedia","depth":"11","categories":"Marcos family\nHistory of the Philippines (1965–1986)","combination":"union","negcats":"","ns[0]":"1","ns[2]":"1","ns[4]":"1","ns[6]":"1","ns[8]":"1","ns[10]":"1","ns[12]":"1","ns[14]":"1","ns[100]":"1","ns[118]":"1","larger":"","smaller":"","since_rev0":"","minlinks":"","maxlinks":"","before":"","after":"","max_age":"","show_redirects":"both","show_soft_redirects":"both","show_disambiguation_pages":"both","edits[bots]":"both","edits[anons]":"both","edits[flagged]":"both","page_image":"any","ores_type":"any","ores_prob_from":"","ores_prob_to":"","ores_prediction":"any","templates_yes":"","templates_any":"","templates_no":"","outlinks_yes":"","outlinks_any":"","outlinks_no":"","links_to_all":"","links_to_any":"","links_to_no":"","sparql":"","manual_list":"","manual_list_wiki":"","pagepile":"","search_query":"","search_wiki":"","search_max_results":"500","wikidata_source_sites":"","namespace_conversion":"topic","subpage_filter":"either","common_wiki":"auto","common_wiki_other":"","source_combination":"","wikidata_item":"no","wikidata_label_language":"","wikidata_prop_item_use":"","wpiu":"any","sitelinks_yes":"","sitelinks_any":"","sitelinks_no":"","min_sitelink_count":"","max_sitelink_count":"","labels_yes":"","cb_labels_yes_l":"1","langs_labels_yes":"","labels_any":"","cb_labels_any_l":"1","langs_labels_any":"","labels_no":"","cb_labels_no_l":"1","langs_labels_no":"","format":"json","output_compatability":"catscan","sortby":"none","sortorder":"ascending","regexp_filter":"","search_filter":"","min_redlink_count":"1","output_limit":"","doit":"Do it!","referrer_url":"","referrer_name":"","interface_language":"en","active_tab":"tab_output"}),
"method": "POST",
"mode": "cors"
})
.then(r => r.json())
.then(d => d["*"][0]["a"]["*"].map(v => new mw.Title(v.nstext ? v.nstext + ":" + v.title : v.title).getPrefixedText()));
const api = new mw.Api({
parameters: {
"formatversion": "2",
"utf8": "true"
}
});
async function getAllRedirects( titles ) {
const foundRedirects = [];
let cont = undefined;
do {
const data = await api.get({
"action": "query",
"format": "json",
"prop": "linkshere",
"titles": titles.join("|"),
"lhcontinue": cont,
"lhprop": "title",
"lhshow": "redirect",
"lhlimit": "500"
});
if ( data.continue && data.continue.lhcontinue ) {
cont = data.continue.lhcontinue;
}
for ( const page of data.query.pages ) {
if ( page.linkshere ) {
foundRedirects.push( ...page.linkshere.map( v => v.title ) );
}
}
} while ( cont != null );
return foundRedirects;
}
const redirects = [];
let finalTitles = [];
while ( scannedPages.length > 0 ) {
const toFind = scannedPages.splice( 0, 50 );
const foundRedirects = await getAllRedirects( toFind );
finalTitles.push( ...scannedPages, ...foundRedirects );
}
finalTitles = [...new Set(finalTitles)];
(new mw.Api()).postWithEditToken({
"action": "edit",
"format": "json",
"title": mw.config.get("wgPageName"),
"section": "1",
"text": `== Pages ==\n{{collapse top|This is a very large list. Open at your own peril.|bg=#F0F2F5}}\n{{div col}}\n${
finalTitles.sort().map(t => `# {{la2|${new mw.Title(t).getPrefixedText()}}}`).join("\n")
}\n{{div col end}}\n{{collapse bottom}}`,
"summary": `Updating page based on PetScan results from ${
(new Date()).toLocaleString("en-GB", { timeZone: "UTC", timeStyle: "short", dateStyle: "medium"})
} (UTC)`,
"utf8": 1
});
} )();