-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
58 lines (51 loc) · 1.5 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
47
48
49
50
51
52
53
54
55
56
57
58
const cron = require("node-cron");
const forrent = require ("./utils/forrent");
const forsale = require ("./utils/forsale");
/*
listingType: huur or koop
propertyType: appartement or woonhuis
searchLocation = den-haag,voorburg, etc.
*/
console.log (`Application started at ${new Date()}`);
//Runs at every hour minute 1 (i.e. 11:01)
cron.schedule("1 * * * *", function() {
console.log("Pulling the properties for rent and updating the DB...");
forrent(
(listingType = "huur"),
(searchLocation = "den-haag,voorburg,leidschendam"),
(priceMin = "0"),
(priceMax = "2000"),
(minLivingArea = "100"),
(minBedroom = "3")
);
});
//Runs at every hour minute 3 (i.e. 11:03)
cron.schedule("3 * * * *", function() {
console.log("Pulling the properties for sale and updating the DB...");
forsale(
(listingType = "koop"),
(searchLocation = "den-haag,voorburg,leidschendam"),
(propertyType = "woonhuis"),
(priceMin = "0"),
(priceMax = "800000"),
(minLivingArea = "100"),
(minBedroom = "3")
);
});
/* forrent(
(listingType = "huur"),
(searchLocation = "den-haag,voorburg,leidschendam"),
(priceMin = "0"),
(priceMax = "2000"),
(minLivingArea = "100"),
(minBedroom = "3")
); */
/* forsale(
(listingType = "koop"),
(searchLocation = "den-haag,voorburg,leidschendam"),
(propertyType = "woonhuis"),
(priceMin = "0"),
(priceMax = "800000"),
(minLivingArea = "100"),
(minBedroom = "3")
); */