mercury-wrapper
Version:
mercury-wrapper utilizes Mercury Parser to extract the full content of the given URL.
18 lines (15 loc) • 378 B
JavaScript
const axios = require('axios');
const postlight = 'https://mercury.postlight.com/parser?url=';
module.exports = key => ({
async parse(url) {
const res = await axios({
method: 'get',
url: `${postlight}${encodeURIComponent(url)}`,
headers: {
'x-api-key': key,
'Content-Type': 'application/json',
},
});
return res;
},
});