Skip to content

Commit

Permalink
✨ 2024년 학사일정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jaryapp committed Feb 22, 2024
1 parent 58499b6 commit 795343e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/scraper/src/schedule-scraper/schedule-scraper.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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: {
Expand Down
8 changes: 8 additions & 0 deletions packages/scraper/src/schedule-scraper/scripts/2024.js
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit 795343e

Please sign in to comment.