Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case "entertainment":
url = "http://feeds.bbci.co.uk/news/entertainment_and_arts/rss.xml?edition=uk";
break;
default:
response.tellWithCard("Unable to understand " + intent.slots.FeedName.value, "RSS Headlines", "Couldn't understand " + intent.slots.FeedName.value);
return;
}
}
else
{
response.tellWithCard("Unable to understand that request", "RSS Headlines", "Couldn't understand the request");
return;
}
parser.parseURL(url, function(err,parsed){
var output = "" + parsed.feed.title + ". ";
var i = 0;
parsed.feed.entries.forEach(function(entry){
if(i <= 4)
{
console.log(entry.title);
output = output + entry.title + ". "
i++;
}
})
var ssmlOutput = {
speech: '' + output + '',
type: AlexaSkill.speechOutputType.SSML
function queueFilingsToCheck() {
console.log('checking RSS');
parser.parseURL('http://efilingapps.fec.gov/rss/generate?preDefinedFilingType=ALL', function(err, parsed) {
if (!err && parsed && parsed.feed && parsed.feed.entries) {
var newFilings = parsed.feed.entries.map(function (filing) {
return parseInt(filing.link.replace('http://docquery.fec.gov/dcdev/posted/','').replace('.fec',''));
});
models.fec_filing.findAll({
attributes: ['filing_id'],
where: {
filing_id: {
gte: _.min(newFilings)
}
}
})
.then(function(filings) {
filings = filings.map(function(filing) {
return filing.filing_id;
return acb => {
if (op.parameters.length) return acb();
rssParser.parseURL(spec.schemes[0] + '://' + spec.host + path, (err, feed) => {
if (err) return acb(err);
feed = feed.feed;
spec.paths[path].get.summary = feed.title;
spec.paths[path].get.description = feed.description;
acb();
})
}
}), err => {
return new Promise((resolve, reject) => {
parser.parseURL(url, (err, data) => {
if (err) {
reject(err);
}
resolve(data.feed);
});
});
}
fetchTracks(callback) {
rssParser.parseURL(this.rssFeedUri,(err,parsed) => {
if ( err ) {
callback(true,[]);
return false;
}
callback(false,parsed.feed.entries);
});
}
host: urlObj.hostname,
basePath: '/',
schemes: [urlObj.protocol.substring(0, urlObj.protocol.length - 1)],
paths: {},
definitions: { Feed: RSS_SCHEMA }
};
spec.paths[urlObj.pathname] = {
get: {
operationId: 'getItems',
description: "Retrieve the RSS feed",
responses: {
'200': { description: "OK", schema: { $ref: '#/definitions/Feed' } }
}
}
};
rssParser.parseURL(url, function (err, feed) {
if (err) return callback(err);
feed = feed.feed;
spec.info = {
title: feed.title,
description: feed.description
};
addIntegration(name, 'rss', spec, callback);
});
};
new Promise((resolve, reject) => {
parseURL(feedUrl, (err, body) => {
if (err) {
return reject(err)
}
const { feed } = body
const entries = feed.entries.map(entry => {
return {
...entry,
comments: entry.comments,
pubDate: moment(new Date(entry.isoDate)).format('HH:mm DD/MM/YYYY'),
}
})
resolve({ ...feed, entries })
})
return new Promise((resolve, reject) => {
rssParser.parseURL(url, (err, parsed) => {
err ? reject(err) : resolve(parsed)
})
})
},
return new Promise((resolve) => {
parser.parseURL(url, resolve);
});
}
return new Promise((resolve, reject) => {
rssParser.parseURL(url, (err, parsed) => {
err ? reject(err) : resolve(parsed)
})
})
},