Compare commits

...

2 commits

Author SHA1 Message Date
Kfir Dayan
0b0a5efe5c add logs 2023-03-28 17:37:15 +03:00
Kfir Dayan
cc5ab4227a done to output.ics 2023-03-28 17:32:32 +03:00
2 changed files with 8 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { GoogleCalendarEvent } from "./types";
import * as ics from 'ics';
const uuid = require('uuid').v4;
const uuid = require('uuid').v4();
export default class Ics {
@ -34,7 +34,7 @@ export default class Ics {
alarms: [],
categories: [],
organizer: { name: 'Maccabi Haifa F.C.', email: '' },
uid: uuid
uid: uuid.toString(),
};
const { error, value } = ics.createEvent(icsEvent);

View file

@ -34,9 +34,14 @@ class App {
const app = new App();
const start = async () => {
const outputFileLocation = 'maccabi-haifa-fc.ics';
console.info("START APP!")
const games = await app.gameSource.getGamesFromHaifa();
console.info("NEW GAMES FOUND!")
const icsEvents = app.ics.generateIcsOutputFromGames(games);
console.log(icsEvents)
console.info("NEW ICS EVENTS GENERATED!" )
fs.writeFileSync(outputFileLocation, icsEvents);
console.log("ICS FILE GENERATED In: " + outputFileLocation)
}