-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
29 lines (26 loc) · 984 Bytes
/
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
const App = require("./sendToGoogleHome");
const randomIntFromInterval = require("./randomizer");
const cTable = require('console.table');
const playSound = require("./playSourd");
(async () => {
while (true) {
const array = [
require("./providers/amazon")(),
require("./providers/ao")(),
require("./providers/argo")(),
require("./providers/very")(),
require("./providers/johnlewis")(),
require("./providers/ebuyer")(),
require("./providers/game")(),
require("./providers/asda")()
];
const responses = await Promise.all(array);
console.table(responses);
const available = responses.filter(i => i.message === "Available");
if (available.length > 0) {
console.log(available);
await playSound();
}
await new Promise(resolve => setTimeout(resolve, randomIntFromInterval(5000, 10000)))
}
})();