Page 1 of 1

Problems incoporating an RSS feed

Posted: Fri Feb 17, 2006 5:48 pm
by PePiPoo
I've been trying to put an RSS feed from my Invision PowerBoard (IPB) forum into the pages of my main website, which I'm building using CMSMS. I've tried using both pirss and the RSS module bundled with CMSMS, but neither produce any output from the IPB feed. However, both work fine with some other RSS feeds.

From this I might say the IPB feed is broken - but it works fine with a couple of feed readers I've tried - Google and Thunderbird!

HELP!

Heres a CMSMS test page with both feeds: http://pepipoo.com/cmsms/index.php?page=Test

Code: Select all

<h3>RSS feeds</h3>
<h4>BBC Sport feed (pirss)</h4>
<p>{pirss url="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/latest_published_stories/rss.xml"}</p>
<h4>IPB forum feed (pirss)<br /></h4>
<p>{pirss url="http://forums.pepipoo.com/index.php?act=rssout&id=2"}</p>
<h4>BBC Sport feed (CMSMS RSS module)</h4>
<p>{cms_module module="rss" url="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/latest_published_stories/rss.xml"}</p>
<h4>IPB forum feed (CMSMS RSS module)</h4>
<p>{cms_module module="rss" url="http://forums.pepipoo.com/index.php?act=rssout&id=2"}</p>
I'd really appreciate it if anyone could point to where the problem lies!

Re: Problems incoporating an RSS feed

Posted: Sat Feb 18, 2006 4:16 pm
by PePiPoo
OK, I've worked out what the problem is at least - neither pirss nor the CMS RSS module can cope with an RSS URL containing an ampersand (&). My IPB feed URL was being converted to http://forums.pepipoo.com/index.php?act ... ]&[/b]id=1. I don't know if there's a more elegant solution, but I added this after line 4 of function.pirss.php and all is now well!

Code: Select all

$url=html_entity_decode($url);
I would guess the RSS module has the same issue.

Re: Problems incoporating an RSS feed

Posted: Sat Feb 18, 2006 4:34 pm
by Ted
Makes sense.  Though, to be fair, most browsers will choke on & if you put it directly into the url line too.  Technically, it's not a correct url.  It's only correct when embedded in HTML.

Re: Problems incoporating an RSS feed

Posted: Sat Feb 18, 2006 5:00 pm
by PePiPoo
Sure, I wouldn't expect a browser to cope with & in a URL. The problem I had was that the RSS URL has a & character in it, which is being HTML encoded before being presented to the pirss function or the RSS module. Pirss (and presumably the RSS module) then tries to do a file() read using the HTML encoded URL - which isn't (as you point out) a valid URL.

Re: Problems incoporating an RSS feed

Posted: Fri Jun 01, 2007 2:56 pm
by mager
PePiPoo wrote: OK, I've worked out what the problem is at least - neither pirss nor the CMS RSS module can cope with an RSS URL containing an ampersand (&). My IPB feed URL was being converted to &[/b]id=1]http://forums.pepipoo.com/index.php?act=rssout&id=1. I don't know if there's a more elegant solution, but I added this after line 4 of function.pirss.php and all is now well!

Code: Select all

$url=html_entity_decode($url);
I would guess the RSS module has the same issue.
Hmm... no one incorportated your fix into this plugin.
Why?

(Could I just do it?)

Martin

Re: Problems incoporating an RSS feed

Posted: Sun Aug 26, 2007 5:11 am
by ctp6360
For people using the CMS Made Simple RSS Plugin the fix for this issue is to:

Line 79 of RSS.module.php

$url=html_entity_decode($url);

This will solve the problem of RSS URLs not working when they contain ampersands (&).

Thanks PePiPoo for this solution.

Is there a way to contribute code fixes such as these back to the main tree?