cron for every min

This commit is contained in:
Kfir Dayan 2023-04-02 11:18:17 +03:00
parent 5e0e203fa3
commit 377f641d49
5 changed files with 1462 additions and 15 deletions

77
maccabi-haifa-fc.ics Normal file
View file

@ -0,0 +1,77 @@
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:https://mhaifafc.com/
METHOD:PUBLISH
X-PUBLISHED-TTL:PT1H
BEGIN:VEVENT
UID:d27oNU81CRFrJItoqCLnW
SUMMARY:Maccabi Haifa F.C.
DTSTAMP:20230402T081739Z
DTSTART:20230404T173000Z
DTEND:20230404T193000Z
DESCRIPTION:Maccabi Tel aviv vs. Maccabi Haifa
URL:https://mhaifafc.com/
LOCATION:Sammy Ofer Stadium
STATUS:CONFIRMED
CATEGORIES:
ORGANIZER;CN=Maccabi Haifa F.C.
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
BEGIN:VEVENT
UID:EW8ndR1-XGchn9ERDCt06
SUMMARY:Maccabi Haifa F.C.
DTSTAMP:20230402T081739Z
DTSTART:20230408T170000Z
DTEND:20230408T190000Z
DESCRIPTION:Maccabi Haifa vs. Maccabi Netanya
URL:https://mhaifafc.com/
LOCATION:Sammy Ofer Stadium
STATUS:CONFIRMED
CATEGORIES:
ORGANIZER;CN=Maccabi Haifa F.C.
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
BEGIN:VEVENT
UID:81viYkz6AgaGWhoWoQAAR
SUMMARY:Maccabi Haifa F.C.
DTSTAMP:20230402T081739Z
DTSTART:20230415T153000Z
DTEND:20230415T173000Z
DESCRIPTION:Hapoel Jerusalem vs. Maccabi Haifa
URL:https://mhaifafc.com/
LOCATION:Sammy Ofer Stadium
STATUS:CONFIRMED
CATEGORIES:
ORGANIZER;CN=Maccabi Haifa F.C.
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
BEGIN:VEVENT
UID:x-lwY95Hy0F_VMZprfU6z
SUMMARY:Maccabi Haifa F.C.
DTSTAMP:20230402T081739Z
DTSTART:20230423T173000Z
DTEND:20230423T193000Z
DESCRIPTION:F.C Ashdod vs. Maccabi Haifa
URL:https://mhaifafc.com/
LOCATION:Sammy Ofer Stadium
STATUS:CONFIRMED
CATEGORIES:
ORGANIZER;CN=Maccabi Haifa F.C.
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
BEGIN:VEVENT
UID:0aphCOxxwj7KQi0QdHpD8
SUMMARY:Maccabi Haifa F.C.
DTSTAMP:20230402T081739Z
DTSTART:20230501T173000Z
DTEND:20230501T193000Z
DESCRIPTION:H Be'er Sheva vs. Maccabi Haifa
URL:https://mhaifafc.com/
LOCATION:Sammy Ofer Stadium
STATUS:CONFIRMED
CATEGORIES:
ORGANIZER;CN=Maccabi Haifa F.C.
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
END:VCALENDAR

1370
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@
"dev": "nodemon dist/index.js"
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^18.15.5"
}
}

View file

@ -1,14 +0,0 @@
// Create a webserver with express
// This is the main webserver for the application
// It is responsible for serving the static files and the API
import express from 'express'
const app = express();
app.use(express.static('public'))
app.listen(3000, () => {
console.log('Example app listening on port 3000!')
})

View file

@ -2,6 +2,8 @@ import GoogleCalendar from './GoogleCalendar';
import GameSource from './GameSource';
import fs from 'fs';
import Ics from './Ics';
import express from 'express'
const CronJob = require('cron').CronJob;
@ -33,9 +35,12 @@ class App {
const app = new App();
console.log("Declaring Cron Job")
const cron = "0 10 * * *" // every day at 10:00
const job = new CronJob(
"0 10 * * *",
"* * * * *",
async () => {
console.log("START")
const outputFileLocation = 'maccabi-haifa-fc.ics';
@ -49,3 +54,11 @@ const job = new CronJob(
);
const webServer = express();
webServer.use(express.static('public'))
webServer.listen(3000, () => {
console.log('Example app listening on port 3000!')
})