diff --git a/index.js b/index.js index 0994e93..13e334c 100644 --- a/index.js +++ b/index.js @@ -104,15 +104,14 @@ const buildOptions = exports.buildOptions = function (params) { const GET = exports.GET = { imageURL: function (node) { + if (node["itunes:image"]) { + return node["itunes:image"][0]['$'].href + } if (node.image) { return node.image[0].url[0] } - if (node["itunes:image"]) { - return node["itunes:image"][0]['$'].href - } - return undefined }, @@ -164,6 +163,13 @@ const GET = exports.GET = { return node['itunes:duration'] }, + keywords: function (node) { + if(node["itunes:keywords"] && node["itunes:keywords"].length > 0){ + return node["itunes:keywords"].map(keywords=>keywords.split(",").map(keyword=>keyword.trim())) + } + return []; + }, + categories: function (node) { // returns categories as an array containing each category/sub-category // grouping in lists. If there is a sub-category, it is the second element diff --git a/package.json b/package.json index ccca555..6d344ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "podcast-feed-parser", - "version": "1.0.4", + "version": "1.0.5", "description": "A highly customizable package for fetching and parsing podcast feeds into simple and manageable JavaScript objects. For use with node and in the browser.", "main": "index.js", "scripts": {