Trying to get content: encoded with jfeed

I can get a successful response from RSS which I am trying to pull using jfeed, however, what I really want is content. [content: encoded] I need this so I can grab the first image from each post.

I figured it would be easy to update jfeed to do this, but I'm not trying to get anything. The most obvious attempt was to add:

item.content = jQuery(this).find('content\:encoded').eq(0).text();

      

but this returns an empty string. I'd really appreciate a push in the right direction, thanks everyone!

0


source to share


1 answer


Caveat: dont know jfeed but i have used many parsers to feed.

With this warning, why are you prefixing the colon with a forward slash? You don't need to do this.



In addition, some package parsers do not use the namespace. Since it content

is a namespace prefix, it is possible that jfeed cannot find()

on this one. In this case, you need to try .find('encoded')

by omitting the namespace prefix.

It is also possible that this feed (or certain items in this feed) does not have an item content:encoded

. This is an RSS extension, not a required item.

+1


source







All Articles