Skip to content

Commit

Permalink
most-imported: include WP:US/L scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Nov 19, 2023
1 parent 840a0d6 commit 36699ef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions reports/most-imported-scripts/most-imported-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,26 @@ process.chdir(__dirname);


/** Get the first 5000 JS pages sorted by number of backlinks
* Should cover every script that has at least 2 backlinks, and many others. */
* Should cover every script that has at least 2 backlinks, and many others.
* This misses some entries (see [[Wikipedia_talk:User_scripts/Most_imported_scripts#New_script_not_included]]),
* so include everything linked from Wikipedia:User scripts/List as well. */
var scriptList = await bot.request({
"action": "query",
"list": "search",
"srsearch": "contentmodel:javascript",
"srnamespace": "2",
"srlimit": "5000",
"srprop": "",
"srsort": "incoming_links_desc"
"srsort": "incoming_links_desc",
"prop": "links",
"titles": "Wikipedia:User scripts/List",
"plnamespace": "2",
"pllimit": "max"
}).then(json => {
log('[S] Got basic script list');
scriptList = json.query.search.map(e => e.title);
scriptList = json.query.search.map(e => e.title).concat(
json.query.pages[0].links.map(e => e.title).filter(e => e.endsWith('.js'))
);
utils.saveObject('scriptList', scriptList);
return scriptList;
});
Expand Down

0 comments on commit 36699ef

Please sign in to comment.