Compare commits
2 commits
67babeac15
...
0b0a5efe5c
Author | SHA1 | Date | |
---|---|---|---|
|
0b0a5efe5c | ||
|
cc5ab4227a |
2 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { GoogleCalendarEvent } from "./types";
|
import { GoogleCalendarEvent } from "./types";
|
||||||
import * as ics from 'ics';
|
import * as ics from 'ics';
|
||||||
|
|
||||||
const uuid = require('uuid').v4;
|
const uuid = require('uuid').v4();
|
||||||
|
|
||||||
|
|
||||||
export default class Ics {
|
export default class Ics {
|
||||||
|
@ -34,7 +34,7 @@ export default class Ics {
|
||||||
alarms: [],
|
alarms: [],
|
||||||
categories: [],
|
categories: [],
|
||||||
organizer: { name: 'Maccabi Haifa F.C.', email: '' },
|
organizer: { name: 'Maccabi Haifa F.C.', email: '' },
|
||||||
uid: uuid
|
uid: uuid.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const { error, value } = ics.createEvent(icsEvent);
|
const { error, value } = ics.createEvent(icsEvent);
|
||||||
|
|
|
@ -34,9 +34,14 @@ class App {
|
||||||
const app = new App();
|
const app = new App();
|
||||||
|
|
||||||
const start = async () => {
|
const start = async () => {
|
||||||
|
const outputFileLocation = 'maccabi-haifa-fc.ics';
|
||||||
|
console.info("START APP!")
|
||||||
const games = await app.gameSource.getGamesFromHaifa();
|
const games = await app.gameSource.getGamesFromHaifa();
|
||||||
|
console.info("NEW GAMES FOUND!")
|
||||||
const icsEvents = app.ics.generateIcsOutputFromGames(games);
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue