0

My Wordpress site is https://chasbroucktest.wordpress.com/2015/07/27/home/ and its RSS Feed is https://chasbroucktest.wordpress.com/feed/. I am trying to grab all the content from within "content:encoded" including the html tags. So far I have the RSS feed reading in.

<cfset rssUrl = "https://chasbroucktest.wordpress.com/feed/">            
<cffeed action="read" source="#rssUrl#" query="entries" properties="info">

How do I call and output the content within "content:encoded"?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72

1 Answers1

1

I suggest an alternative solution using cfhttp tag. Read the rss and parse the xml into object and search for content:encoded

Here is a sample code.

<cfset rssUrl = "https://chasbroucktest.wordpress.com/feed/">

<cfhttp url="#rssUrl#" result="hello">

<cfset data = XmlParse(hello.Filecontent)>
<cfset content = XmlSearch(data,"//content:encoded/text()")>
<cfloop array="#content#" index="feed">
    <cfoutput>#feed.XmlValue#</cfoutput>
</cfloop>
robenrajan
  • 355
  • 1
  • 8
  • @ConnerHasbrouck - Obviously in the real code, check the status code for errors first and only do the parsing if the call was successful. – Leigh Jul 30 '15 at 17:44