From 70aa6c0dd29709d7ce48fec2dcc00b02f29ee196 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Sun, 2 Apr 2023 15:40:12 +0300 Subject: [PATCH] fixing saving to public folder --- maccabi-haifa-fc.ics | 20 ++++++++++---------- src/index.ts | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/maccabi-haifa-fc.ics b/maccabi-haifa-fc.ics index aa03f7b..d9491d4 100644 --- a/maccabi-haifa-fc.ics +++ b/maccabi-haifa-fc.ics @@ -5,9 +5,9 @@ PRODID:https://mhaifafc.com/ METHOD:PUBLISH X-PUBLISHED-TTL:PT1H BEGIN:VEVENT -UID:_5qS0t0NPnxt7ysQhiM1b +UID:Od0AeXkvLYZ2ELyVyCf3w SUMMARY:Maccabi Haifa F.C. -DTSTAMP:20230402T122458Z +DTSTAMP:20230402T123647Z DTSTART:20230404T173000Z DTEND:20230404T193000Z DESCRIPTION:Maccabi Tel aviv vs. Maccabi Haifa @@ -19,9 +19,9 @@ ORGANIZER;CN=Maccabi Haifa F.C. X-MICROSOFT-CDO-BUSYSTATUS:BUSY END:VEVENT BEGIN:VEVENT -UID:gOdljSPvOnSsLTwF_JSdA +UID:OCMexF1apX1IoP8K9qHCQ SUMMARY:Maccabi Haifa F.C. -DTSTAMP:20230402T122458Z +DTSTAMP:20230402T123647Z DTSTART:20230408T170000Z DTEND:20230408T190000Z DESCRIPTION:Maccabi Haifa vs. Maccabi Netanya @@ -33,9 +33,9 @@ ORGANIZER;CN=Maccabi Haifa F.C. X-MICROSOFT-CDO-BUSYSTATUS:BUSY END:VEVENT BEGIN:VEVENT -UID:6VKjleqclIMSj6TG7bx4_ +UID:4Qab1aW2S5xDL3OC-3_sA SUMMARY:Maccabi Haifa F.C. -DTSTAMP:20230402T122458Z +DTSTAMP:20230402T123647Z DTSTART:20230415T153000Z DTEND:20230415T173000Z DESCRIPTION:Hapoel Jerusalem vs. Maccabi Haifa @@ -47,9 +47,9 @@ ORGANIZER;CN=Maccabi Haifa F.C. X-MICROSOFT-CDO-BUSYSTATUS:BUSY END:VEVENT BEGIN:VEVENT -UID:yabS2xjYG6txukIHZCeFV +UID:N3At5VutrWAUaQiaNkwm6 SUMMARY:Maccabi Haifa F.C. -DTSTAMP:20230402T122458Z +DTSTAMP:20230402T123647Z DTSTART:20230423T173000Z DTEND:20230423T193000Z DESCRIPTION:F.C Ashdod vs. Maccabi Haifa @@ -61,9 +61,9 @@ ORGANIZER;CN=Maccabi Haifa F.C. X-MICROSOFT-CDO-BUSYSTATUS:BUSY END:VEVENT BEGIN:VEVENT -UID:cuLZKgXMny8Utk3LInSVj +UID:QTleUThXSlGWTOZo2moK5 SUMMARY:Maccabi Haifa F.C. -DTSTAMP:20230402T122458Z +DTSTAMP:20230402T123647Z DTSTART:20230501T173000Z DTEND:20230501T193000Z DESCRIPTION:H Be'er Sheva vs. Maccabi Haifa diff --git a/src/index.ts b/src/index.ts index 56a22bc..d8dfac6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,8 +34,7 @@ class App { } const app = new App(); - -console.log("Declaring Cron Job") +console.log("Declaring Cron Job every day at 10:00") const cron = "0 10 * * *" // every day at 10:00 @@ -43,10 +42,11 @@ const job = new CronJob( "* * * * *", async () => { console.log("START") - const outputFileLocation = 'maccabi-haifa-fc.ics'; + const outputFileLocation = 'public/maccabi-haifa-fc.ics'; const games = await app.gameSource.getGamesFromHaifa(); const icsEvents = app.ics.generateIcsOutputFromGames(games); fs.writeFileSync(outputFileLocation, icsEvents); + console.log("END") }, null, true,