-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
48 lines (36 loc) · 1.4 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
require('dotenv').config({path: ".env"})
const path = require('path'),
ora = require('ora'),
currentPath = path.resolve(__dirname, 'boletos')
const scrappers = {
unimed: require('./scrappers/unimed'),
copel: require('./scrappers/copel'),
ultragaz: require('./scrappers/ultragaz'),
das: require('./scrappers/das'),
}
async function start() {
let spinner;
spinner = ora('Iniciando o BotBoleto').start();
spinner.succeed()
spinner = ora('Iniciando o UnimedBot').start();
spinner = await scrappers.unimed(currentPath, spinner)
spinner.text = 'UnimedBot finalizado!';
spinner.succeed()
spinner = ora('Iniciando o CopelBot').start();
spinner = await scrappers.copel(currentPath, spinner)
spinner.text = 'CopelBot finalizado!';
spinner.succeed()
spinner = ora('Iniciando o UltragazBot').start();
spinner = await scrappers.ultragaz(currentPath, spinner)
spinner.text = 'UltragazBot finalizado!';
spinner.succeed()
spinner = ora('Iniciando o DASMEIBot #1').start();
spinner = await scrappers.das(currentPath, spinner, process.env.DAS_CNPJ1)
spinner.text = 'DASMEIBot #1 finalizado!';
spinner.succeed()
spinner = ora('Iniciando o DASMEIBot #2').start();
spinner = await scrappers.das(currentPath, spinner, process.env.DAS_CNPJ2)
spinner.text = 'DASMEIBot #2 finalizado!';
spinner.succeed()
}
start()