lyg
2024-07-18 88b729bf6ba62b7e50b7393bbe93f71ad8c16044
src/book-list-download.mjs
@@ -62,9 +62,9 @@
}
async function main() {
  const years = genYears(2023, 2024);
  const years = genYears(1950, 2024);
  const codeList = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
  const bookList = [["id", "isbn", "主标题", "副标题", "作者", "出版社", "出版时间", "中图法分类", "格式", "语言", "简介", "页数"]];
  const bookList = [["Title", "Author", "Year", "Publisher", "ISBN"]];
  try {
    for (const year of years) {
      for (const code of codeList) {
@@ -85,7 +85,7 @@
            const { identifier, title, creator } = hit.fields
            const author = creator?.join(", ");
            console.log(`${identifier} | ${title} | ${author??''}`);
            bookList.push([identifier, "", title, "", author, "", "", "", "", "English"]);
            bookList.push([title, author, null, null, null]);
          }
          page++;
          await sleep(getRandomNumber(3000, 80000));
@@ -106,8 +106,10 @@
  }
}
initLogger();
main()
  .finally(() => {
    logFile.close();
  });
  });