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 |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1:
$(function() {
const wikiSlash = mw.config.get("wgArticlePath").replace("$1", '');
const links = $("#mw-content-text").find(`a[href
let titles = [];
let finalTitle;
$(links).each(function() {
finalTitle = titles.join("|");▼
});
let queryableTitles = titles.slice(0, 40);
$.get('/w/api.php?' +▼
$.param({▼
var params = {
format: 'json',▼
list: 'categorymembers',
titles: finalTitle▼
cmtitle: "Featured articles"
})).done(function() { console.log(data) });▼
},
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?' +
// action: 'query',
// prop: 'categories',
});
|