• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

RSS anyone?

Explorer ,
Mar 04, 2008 Mar 04, 2008

Copy link to clipboard

Copied

I can't get this to work and I'm sure the answer is obvious. I'm new to integrating RSS. I'm trying to display RSS feeds on my website from other URLs. Thanks for any light you can shed on this!

here is my code in a standard .cfm page-----------------------------------------------------------------
<cfscript>
URLToPull = " http://www.easycfm.com/syndication/mostviewed.cfm";
</cfscript>


<cfhttp url="#URLToPull#"
method="GET"
timeout="15">
</cfhttp>

<cfscript>
XMLContent = trim(cfhttp.filecontent);
XMLContent = XMLParse(XMLContent);
</cfscript>--------------------------------------------------------------------------------------------

Here is the error I get -------------------------------------------------------

An error occured while Parsing an XML document.
Content is not allowed in prolog.

The error occurred in D:\Hosting\kapman\somthing\testrss.cfm: line 26

24 : <cfscript>
25 : XMLContent = trim(cfhttp.filecontent);
26 : XMLContent = XMLParse(XMLContent);
27 : </cfscript>
28 : ------------------------------------------------------------------------------------------------

The tutorial for this is below if your interested, thanks for any help!!

http://tutorial208.easycfm.com/
TOPICS
Advanced techniques

Views

391

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Mar 05, 2008 Mar 05, 2008
Ahhh freakn Godaddy! Proxy issue. here is the fix. Thanks for the help guys!

<cfhttp method="GET" url="blah.rss" proxyserver="proxy.shr.secureserver.net" proxyport="3128">

Votes

Translate

Translate
Engaged ,
Mar 04, 2008 Mar 04, 2008

Copy link to clipboard

Copied

It means that the parser is finding (what it considers) non-XML content as part of the XML page.

It's been a whil esince I have done RSS/XML, but there are a couple of possible reasons.

What I would suggest you do first is dump the XMLContent variable after it is first assigned in line 25 (comment out line 26 for now). If it shows some weird little characters at the beginning of the data content, then you will have to trim that out first before parsing the XML itself.

Another reason may be the CDATA entries, but I'm pretty sure I've had it work with CDATA before.

Post the output from the dump above and we can probably see the issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 04, 2008 Mar 04, 2008

Copy link to clipboard

Copied

Hi,
What is ur development environment? I tried your code and did not get any error while parsing. I am using CF 8.

-Prasanth

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 05, 2008 Mar 05, 2008

Copy link to clipboard

Copied

Hey thanks for the followup, I'm on a Godaddy server running MX7. I was thinking that maybe they had some restrictions given the line "Content is not allowed in prolog." Whatever prolog is

SafariTECH - I'll give that a go, thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 05, 2008 Mar 05, 2008

Copy link to clipboard

Copied

LATEST
Ahhh freakn Godaddy! Proxy issue. here is the fix. Thanks for the help guys!

<cfhttp method="GET" url="blah.rss" proxyserver="proxy.shr.secureserver.net" proxyport="3128">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation