summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/index.js b/index.js
index 88930aa..8350c9c 100644
--- a/index.js
+++ b/index.js
@@ -72,10 +72,7 @@ function delayP(delay) {
});
}
-(async () => {
- const channel = 'yogscast'; // a random channel
- const runForMs = 3600 * 1000; // 1 hour
-
+async function watch(channel,runForMs=3600 * 1000 /* 1 hour */) {
const x = await goThere(channel);
const started = Date.now();
@@ -86,4 +83,14 @@ function delayP(delay) {
}
await x.browser.close();
+}
+
+const channels = [ 'yogscast', 'yogscast' ];
+
+(async () => {
+ const watchers = channels.map(
+ (c) => watch(c)
+ );
+
+ await Promise.all(watchers);
})();