-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflight-scrappper-app.js
65 lines (63 loc) · 1.36 KB
/
flight-scrappper-app.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
59
60
61
62
63
64
65
let FlightScrappper = require('./dist/flight-scrappper');
let debug = require('debug')('flight-scrappper-app.js');
let Utils = require('./src/utils');
let options = {
periods: 40,
interval: 48,
currency: 'EUR',
directFlight: false,
dateFormat: 'DD-MM-YYYY',
targetDate: Utils.getDefaultDateString('DD-MM-YYYY'),
database: 'localhost:27017/flight-scrappper',
collection: 'flight-data',
timeout: 80000,
browser: 'chrome',
chromedriverArgs: ['--verbose', '--log-path=chromedriver.log'],
maximize: false,
retries: 1,
routes: [{
from: 'MAD',
to: 'LON'
}, {
from: 'LIS',
to: 'MAA'
}, {
from: 'LIS',
to: 'TYO'
}, {
from: 'LIS',
to: 'DPS'
}, {
from: 'LIS',
to: 'MLE'
}, {
from: 'LIS',
to: 'LAD'
}, {
from: 'LIS',
to: 'LON'
}, {
from: 'LIS',
to: 'MIL'
}, {
from: 'LIS',
to: 'PAR'
}, {
from: 'LIS',
to: 'BCN'
}, {
from: 'LIS',
to: 'IST'
}, {
from: 'LIS',
to: 'NYC'
}, {
from: 'LIS',
to: 'BER'
}]
};
FlightScrappper.run(options).then((value) => {
debug('Resolved: ' + Utils.prettifyObject(value.length) + ' flights!');
}).catch(function(err) {
debug('Found an error! ' + err);
});