-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.js
33 lines (21 loc) · 887 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
29
30
31
32
33
/*
* @author Balogun Wahab A.
* ig-bot
* 11/11/18 6:22 PM
*/
const Bot = require('./Bot');// this directly imports the index.js file
const config = require('./Bot/config/puppeteer');
const run = async () => {
const bot = new Bot();
const startTime = Date();
await bot.initPuppeter().then(() => console.log("PUPPETEER INITIALIZED"));
await bot.visitInstagram().then(() => console.log("BROWSING INSTAGRAM"));
await bot.visitHashtagUrl().then(() => console.log("VISITED HASH-TAG URL"));
await bot.unFollowUsers();
await bot.closeBrowser().then(() => console.log("BROWSER CLOSED"));
const endTime = Date();
console.log(`START TIME - ${startTime} / END TIME - ${endTime}`)
};
run().catch(e=>console.log(e.message));
//run bot at certain interval we have set in our config file
setInterval(run, config.settings.run_every_x_hours * 3600000);