use new fancy logging in edb and gt scripts

This commit is contained in:
ewin 2025-09-04 23:07:48 -04:00
parent ded35a743d
commit ef69ee4c9f
Signed by: erin
SSH key fingerprint: SHA256:swjoHhREbZPbWe+gyJNi24d4NAxJSyUIm3fpZj4z3wc
2 changed files with 6 additions and 4 deletions

View file

@ -47,7 +47,8 @@ const pages = (await Promise.all(Object.entries(categoryTypes).map(async ([categ
console.log('Processing', pages.length, 'items\n'); console.log('Processing', pages.length, 'items\n');
for (const {title, type} of pages) { for (const page of pages) {
const {title, type} = page;
// this runs serially with an artificial delay between requests to decrease // this runs serially with an artificial delay between requests to decrease
// the chance of sqenix sending ninjas to my house // the chance of sqenix sending ninjas to my house
await new Promise(resolve => setTimeout(resolve, 1000)); await new Promise(resolve => setTimeout(resolve, 1000));
@ -73,7 +74,7 @@ for (const {title, type} of pages) {
let updatedText; let updatedText;
try { try {
updatedText = insertInfoboxEDBID(originalText, edbID); updatedText = insertInfoboxEDBID(originalText, edbID);
diff(originalText, updatedText); diff(originalText, updatedText, page);
} catch (error) { } catch (error) {
console.log('Error inserting parameter:', error); console.log('Error inserting parameter:', error);
console.group('Bad page content:'); console.group('Bad page content:');

View file

@ -38,7 +38,8 @@ const mw = await getMediawikiClient();
const itemPagesWithoutGTIDs = await mw.listCategoryPages('Category:Missing internal ID', [0], +process.env.LIMIT || 500); const itemPagesWithoutGTIDs = await mw.listCategoryPages('Category:Missing internal ID', [0], +process.env.LIMIT || 500);
console.log('Processing', itemPagesWithoutGTIDs.length, 'item pages from [[Category:Missing internal ID]]\n'); console.log('Processing', itemPagesWithoutGTIDs.length, 'item pages from [[Category:Missing internal ID]]\n');
for (const {title} of itemPagesWithoutGTIDs) { for (const page of itemPagesWithoutGTIDs) {
const {title} = page;
console.log('Page:', title); console.log('Page:', title);
// look up on XIVAPI // look up on XIVAPI
let gtID; let gtID;
@ -65,7 +66,7 @@ for (const {title} of itemPagesWithoutGTIDs) {
let updatedText; let updatedText;
try { try {
updatedText = insertInfoboxGTBID(originalText, gtID); updatedText = insertInfoboxGTBID(originalText, gtID);
diff(originalText, updatedText); diff(originalText, updatedText, page);
} catch (error) { } catch (error) {
console.log('Error inserting parameter:', error); console.log('Error inserting parameter:', error);
console.group('Bad page content:'); console.group('Bad page content:');