-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscraper.js
24 lines (21 loc) · 863 Bytes
/
scraper.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
const Nightmare = require('nightmare');
const Mailgun = require('mailgun-js');
const moment = require('moment');
const config = require('./config');
const airasia = require('./airasia');
const domain = config.mailgunDomain;
const apiKey = config.mailgunApiKey;
const mailgun = Mailgun({domain: domain, apiKey: apiKey});
const nightmare = Nightmare({ show: false });
// Start AirAsia scraper
const airasiaInput = {
fromLocation: 'Jakarta', // Jakarta
toLocation: 'Singapore', // Singapore
fromDate: '01/05/2017', // 01/05/2017
toDate: '13/05/2017', // 13/05/2017
passenger: '1', // 1
recipient: '[email protected]', // [email protected] (can be comma separated)
cc: '', // [email protected]
bcc: '' // [email protected]
};
airasia.scrap(nightmare, mailgun, airasiaInput);