use new fancy logging in edb and gt scripts
This commit is contained in:
parent
ded35a743d
commit
ef69ee4c9f
2 changed files with 6 additions and 4 deletions
|
|
@ -47,7 +47,8 @@ const pages = (await Promise.all(Object.entries(categoryTypes).map(async ([categ
|
|||
|
||||
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
|
||||
// the chance of sqenix sending ninjas to my house
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
|
@ -73,7 +74,7 @@ for (const {title, type} of pages) {
|
|||
let updatedText;
|
||||
try {
|
||||
updatedText = insertInfoboxEDBID(originalText, edbID);
|
||||
diff(originalText, updatedText);
|
||||
diff(originalText, updatedText, page);
|
||||
} catch (error) {
|
||||
console.log('Error inserting parameter:', error);
|
||||
console.group('Bad page content:');
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ const mw = await getMediawikiClient();
|
|||
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');
|
||||
|
||||
for (const {title} of itemPagesWithoutGTIDs) {
|
||||
for (const page of itemPagesWithoutGTIDs) {
|
||||
const {title} = page;
|
||||
console.log('Page:', title);
|
||||
// look up on XIVAPI
|
||||
let gtID;
|
||||
|
|
@ -65,7 +66,7 @@ for (const {title} of itemPagesWithoutGTIDs) {
|
|||
let updatedText;
|
||||
try {
|
||||
updatedText = insertInfoboxGTBID(originalText, gtID);
|
||||
diff(originalText, updatedText);
|
||||
diff(originalText, updatedText, page);
|
||||
} catch (error) {
|
||||
console.log('Error inserting parameter:', error);
|
||||
console.group('Bad page content:');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue