cron for every min
This commit is contained in:
parent
5e0e203fa3
commit
377f641d49
5 changed files with 1462 additions and 15 deletions
77
maccabi-haifa-fc.ics
Normal file
77
maccabi-haifa-fc.ics
Normal 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
1370
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -13,6 +13,7 @@
|
||||||
"dev": "nodemon dist/index.js"
|
"dev": "nodemon dist/index.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/express": "^4.17.17",
|
||||||
"@types/node": "^18.15.5"
|
"@types/node": "^18.15.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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!')
|
|
||||||
})
|
|
15
src/index.ts
15
src/index.ts
|
@ -2,6 +2,8 @@ import GoogleCalendar from './GoogleCalendar';
|
||||||
import GameSource from './GameSource';
|
import GameSource from './GameSource';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import Ics from './Ics';
|
import Ics from './Ics';
|
||||||
|
import express from 'express'
|
||||||
|
|
||||||
|
|
||||||
const CronJob = require('cron').CronJob;
|
const CronJob = require('cron').CronJob;
|
||||||
|
|
||||||
|
@ -33,9 +35,12 @@ class App {
|
||||||
|
|
||||||
const app = new App();
|
const app = new App();
|
||||||
|
|
||||||
|
console.log("Declaring Cron Job")
|
||||||
|
|
||||||
|
const cron = "0 10 * * *" // every day at 10:00
|
||||||
|
|
||||||
const job = new CronJob(
|
const job = new CronJob(
|
||||||
"0 10 * * *",
|
"* * * * *",
|
||||||
async () => {
|
async () => {
|
||||||
console.log("START")
|
console.log("START")
|
||||||
const outputFileLocation = 'maccabi-haifa-fc.ics';
|
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!')
|
||||||
|
})
|
Loading…
Reference in a new issue