I’m parsing an RSS feed with jgFeed
I get all the elements of the RSS (link,title,content..) except the enclosure value.
I have debugged with Firebug and it seems that jGFeed is not parsing the enclosure item
Here’s the code that I have written.
$.jGFeed('rssurl',
function(feeds){
// Check for errors
if(!feeds){
// there was an error
return false;
}
// do whatever you want with feeds here
for(var i=0; i<3; i++){
var entry = feeds.entries[i];
// Entry title
alert(entry.mediaGroups);
/* alert (entry.link);
alert(entry.enclosure);
alert(entry.contentSnippet);
alert(entry.publishedDate);*/
}
}, 10);
How can I ensure that I parse the enclosure item?
Ensure you run
console.log(feeds)and breakdown the info you are getting from the rss feed that you are pulling data from.See this blog posting.