1
0
mirror of https://github.com/comatory/fb2iCal synced 2024-12-27 08:52:58 +01:00
Facebook-Events-iCal-Converter/lib/services/crawler.js
2019-10-23 20:37:06 +02:00

25 lines
490 B
JavaScript

const request = require('request')
const crawl = async (url) => {
return new Promise((resolve, reject) => {
console.info(`Started request for URL: ${url}`)
request({
url,
headers: {
'Accept-Language': 'en-US, en',
'User-Agent': 'request',
},
}, (err, res, body) => {
if (err) {
reject(err)
return
}
console.info(`Finished request for URL: ${url}`)
resolve(body)
})
})
}
module.exports = crawl