Reputation: 181
I'm using google feeds API to read RSS-feeds from Libsyn.
As i've noticed Google parses the feed itself and therefore excludes a lot of stuff. Is there any way to change this so that it would include an image link included in the RSS-feed?
var feed = new google.feeds.Feed('http://podiet.libsyn.com/rss');
feed.setNumEntries(25);
feed.load(function (data) {
console.log(data);
});
It's all working perfectly fine except the fact that some of the things in the feed are excluded.
Upvotes: 1
Views: 188
Reputation: 2234
Set:
feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT)
Then the image tags will be included. They can be extracted like this for example:
var feed = new google.feeds.Feed('http://podiet.libsyn.com/rss');
feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT);
feed.setNumEntries(25);
feed.load(function(result) {
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var itunesImageUrl = entry.xmlNode.getElementsByTagNameNS(
'http://www.itunes.com/dtds/podcast-1.0.dtd', 'image')[0].
attributes.getNamedItem('href').value;
console.log(itunesImageUrl);
}
});
Upvotes: 0