Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
socket.on('parse:article', function (msg) {
options.url = msg.url
if (msg.tor === true) {
options.puppeteer.args = ['--proxy-server=socks5://127.0.0.1:9050']
}
parser.parseArticle(options, socket)
.then(function (article) {
var response = {
title: article.title.text,
metadescription: article.meta.description.text,
url: article.url,
sentiment: article.sentiment,
keyphrases: article.processed.keyphrases,
people: article.people,
orgs: article.orgs,
places: article.places,
text: {
raw: article.processed.text.raw,
formatted: article.processed.text.formatted,
html: article.processed.text.html
},
html: article.processed.html,