From 795343e5b5939035f69bf38ce32e5b9f2b8a38a5 Mon Sep 17 00:00:00 2001 From: jess Date: Thu, 22 Feb 2024 22:00:03 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=202024=EB=85=84=20=ED=95=99=EC=82=AC?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scraper/src/schedule-scraper/schedule-scraper.ts | 12 ++++++------ .../scraper/src/schedule-scraper/scripts/2024.js | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 packages/scraper/src/schedule-scraper/scripts/2024.js diff --git a/packages/scraper/src/schedule-scraper/schedule-scraper.ts b/packages/scraper/src/schedule-scraper/schedule-scraper.ts index bfc3f62d6..9f03bb7c8 100644 --- a/packages/scraper/src/schedule-scraper/schedule-scraper.ts +++ b/packages/scraper/src/schedule-scraper/schedule-scraper.ts @@ -1,6 +1,6 @@ import { ScheduleApiService } from "@shared/swagger-api/generated/services/ScheduleApiService"; import { login } from "src/common/login"; -import schdule2023 from "src/schedule-scraper/scripts/2023"; +import schdule2024 from "src/schedule-scraper/scripts/2024"; import { scraping } from "../scraper/scraper"; import arrayToDate from "./utils"; @@ -11,16 +11,16 @@ export const scrapingSchdule = async () => { const schdules = await scraping({ scenario: { name: "학사일정", - url: schdule2023.url, - waitSelector: schdule2023.waitCalendarSelector, - jsScript: schdule2023, - scrapFunctionName: schdule2023.getSchedules.name, + url: schdule2024.url, + waitSelector: schdule2024.waitCalendarSelector, + jsScript: schdule2024, + scrapFunctionName: schdule2024.getSchedules.name, }, }); for (const schdule of schdules) { const [ arrayDate, content ] = schdule; - const { start_date, end_date } = arrayToDate(schdule2023.year, arrayDate); + const { start_date, end_date } = arrayToDate(schdule2024.year, arrayDate); await ScheduleApiService.scheduleControllerCreate({ requestBody: { diff --git a/packages/scraper/src/schedule-scraper/scripts/2024.js b/packages/scraper/src/schedule-scraper/scripts/2024.js new file mode 100644 index 000000000..f2f600b9f --- /dev/null +++ b/packages/scraper/src/schedule-scraper/scripts/2024.js @@ -0,0 +1,8 @@ +import year2020 from "./2020"; + +const script = { + url: "https://www.chungbuk.ac.kr/site/www/sub.do?key=1916", + year: 2024, +}; + +export default { ...year2020, ...script };