Skip to content

Commit

Permalink
Update OSRSWikiAuto-Categorizer-SlowMode.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick2bad4u committed Oct 27, 2024
1 parent bbd0ab8 commit 039aded
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions OSRSWikiAuto-Categorizer-SlowMode.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@
// All categories have been fetched
console.log(`All categories for '${pageTitle}':`, categories);

// Exit if the page has no categories
if (categories.length === 0) {
console.log(`Skipped: '${pageTitle}' has no existing categories.`);
actionLog.push(`Skipped: '${pageTitle}' has no existing categories.`);
callback();
return;
}

// Standardize target category name
const standardizedCategoryName = standardizeCategoryName(`Category:${categoryName}`);

Expand Down Expand Up @@ -340,6 +348,7 @@




function fetchCsrfToken(callback) {
const apiUrl = 'https://oldschool.runescape.wiki/api.php?action=query&meta=tokens&type=csrf&format=json';
GM_xmlhttpRequest({
Expand Down

0 comments on commit 039aded

Please sign in to comment.