From 1682ba16b10a521e5fd943922f8379ebb5cd2804 Mon Sep 17 00:00:00 2001 From: lyg <1543117173@qq.com> Date: 星期二, 23 七月 2024 16:31:46 +0800 Subject: [PATCH] 修改图书下载逻辑 --- src/book-list-download.mjs | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/book-list-download.mjs b/src/book-list-download.mjs index d07ae42..727d019 100644 --- a/src/book-list-download.mjs +++ b/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(); - }); \ No newline at end of file + }); + -- Gitblit v1.9.1