Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
},

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down