Skip to content

Commit

Permalink
fix report
Browse files Browse the repository at this point in the history
kanasimi committed Dec 15, 2024

Verified

This commit was signed with the committer’s verified signature.
kanasimi kanasimi
1 parent 371f8db commit 9df4f1f
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions routine/20210422.Sorting_category_and_sort_key_of_Thai_names.js
Original file line number Diff line number Diff line change
@@ -82,18 +82,35 @@ Bernard Trink
Ajaan Suwat Suvaco`.split('\n').forEach(t => Thai_people_page_list.add(t));
}

const non_biographical_page_titles = [['#', 'Page']];
const non_biographical_page_titles = [];
// run through all pages of Thai_name_categories
await wiki.for_each_page(Thai_people_page_list,
[for_each_Thai_people_page, {
Thai_name_CATEGORY_LIST, non_biographical_page_titles,
}],
{ summary: summary_prefix });

await wiki.edit_page('Wikipedia:WikiProject Thailand/Nonbiographical pages transcluding Thai name categories',
'The pages below are pages transcluding Thai name categories but detect as non-biographical articles.\n'
+ CeL.wiki.array_to_table(non_biographical_page_titles.sort().map((page_title, index) => [index + 1, CeL.wiki.title_link_of(page_title)]), { class: 'wikitable sortable' }), {
summary: summary_prefix + `Report ${non_biographical_page_titles.length} non-biographical articles.`
const report_lines = [];
let summary;
if (non_biographical_page_titles.length > 0) {
summary = `Report ${non_biographical_page_titles.length} non-biographical articles.`;
const report_titles = non_biographical_page_titles
.sort()
.map((page_title, index) => [index + 1, CeL.wiki.title_link_of(page_title)]);
// free
non_biographical_page_titles.truncate();
report_titles.unshift(['#', 'Page']);

report_lines.push('The pages below are pages transcluding Thai name categories but detect as non-biographical articles.',
CeL.wiki.array_to_table(report_titles, { class: 'wikitable sortable' })
);
} else {
summary = `No non-biographical articles.`;
report_lines.push(summary);
}

await wiki.edit_page('Wikipedia:WikiProject Thailand/Nonbiographical pages transcluding Thai name categories', report_lines.join(''), {
summary: summary_prefix + summary
});

routine_task_done('1 week');

0 comments on commit 9df4f1f

Please sign in to comment.