Content deleted Content added
No edit summary |
m JJPMaster moved page User:JJPMaster/GreenAndGold.js to User:JJPMaster/Scripts/GreenAndGold.js: cleaning up my userspace |
||
(23 intermediate revisions by the same user not shown) | |||
Line 1:
$(function()
const
const links = $("#mw-content-text").find(`a[href^='${wikiSlash}']`);
$(links).each((i) => {▼
let titles = [];
let finalTitle;
titles.push(decodeURI($(this).attr("href").replace(wikiSlash, '')));
});
let queryableTitles = titles.slice(0, 40);
finalTitle = queryableTitles.join("|");
var params = {
action: 'query',
format: 'json',
list: 'categorymembers',
cmtitle: "Featured articles"
},
api = new mw.Api();
api.get( params ).done( function ( data ) {
// var pages = data.query.pages,
// p;
// for ( p in pages ) {
// pages[ p ].categories.forEach( function ( cat ) {
// console.log( cat.title );
// } );
// }
console.log(data);
});
// $.get('/w/api.php?' +
// $.param({
// format: 'json',
// action: 'query',
// prop: 'categories',
// titles: finalTitle
// })).done(function(data) { console.log(data) });
});
|