-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (39 loc) · 1.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const express = require('express')
const schedule = require('node-schedule');
const { PORT } = require('./config')
const { cvs } = require('./controller')
const { FgCyan, Reset } = require('./config/color')
const app = express()
const server = app.listen(PORT, async () => {
})
console.log('=====================================')
console.log("= Covid Vaccine Appointment Scanner =")
console.log('=====================================')
try {
console.log("Checking CVS for avaliable appointments...")
cvs.checkStateAppointmentsByCities()
.then(() => {
console.log("Checking Again in 30 minutes...\n")
})
.then(() => {
console.log("Checking RiteAid for avaliable appointments...")
console.log(FgCyan, "<functionality pending...>", Reset)
})
.then(() => {
console.log("Checking Walgreens for avaliable appointments...")
console.log(FgCyan, "<functionality pending...>", Reset)
})
} catch (err) {
console.log(err)
}
try {
const cvsJob = schedule.scheduleJob('* 30 * * *', function () {
console.log("Checking CVS for avaliable appointments...")
cvs.checkStateAppointmentsByCities()
.then(() => {
console.log("Checking Again in 30 minutes...\n")
})
});
} catch (err) {
console.log(err)
}