Compare commits

..

No commits in common. "5e0e203fa3d2fabbf9ff749540e82029af88ba3e" and "d6d682a4b0873da3b7f508742b2f0059d3d94ce7" have entirely different histories.

4 changed files with 1289 additions and 19 deletions

1
.gitignore vendored
View file

@ -14,4 +14,3 @@ tmp
config/client_google_auth.json config/client_google_auth.json
## output ## ## output ##
dist

1282
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,6 @@
{ {
"dependencies": { "dependencies": {
"axios": "^1.3.4", "axios": "^1.3.4",
"cron": "^2.3.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"express": "^4.18.2", "express": "^4.18.2",
"googleapis": "^113.0.0", "googleapis": "^113.0.0",

View file

@ -3,8 +3,6 @@ import GameSource from './GameSource';
import fs from 'fs'; import fs from 'fs';
import Ics from './Ics'; import Ics from './Ics';
const CronJob = require('cron').CronJob;
class App { class App {
googleCalendar: GoogleCalendar; googleCalendar: GoogleCalendar;
@ -33,19 +31,11 @@ class App {
const app = new App(); const app = new App();
const start = async () => {
const job = new CronJob( const outputFileLocation = 'public/maccabi-haifa-fc.ics';
"0 10 * * *",
async () => {
console.log("START")
const outputFileLocation = 'maccabi-haifa-fc.ics';
const games = await app.gameSource.getGamesFromHaifa(); const games = await app.gameSource.getGamesFromHaifa();
const icsEvents = app.ics.generateIcsOutputFromGames(games); const icsEvents = app.ics.generateIcsOutputFromGames(games);
fs.writeFileSync(outputFileLocation, icsEvents); fs.writeFileSync(outputFileLocation, icsEvents);
}, }
null,
true,
'Asia/Jerusalem'
);
start();