<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Forum posts to 'Site Builders'</title>
		<link>http://www.silverstripe.com/site-builders-forum/</link>
		

		
		<item>
			<title>Re: restful service rss</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=240843</link>
			<description>With 2.3 coming up I decided to use the RestfulService.php from the 2.3 branch instead of the current stable one, and as it is pretty self contained it seems to work fine on 2.2.3.&lt;br /&gt;&lt;br /&gt;The problem I had was with the difference in format between RSS feeds of different versions: RSS 1.0 places the &amp;lt;item&amp;gt; tags outside the &amp;lt;channel&amp;gt;, while RSS 2.0 places them outside. The end result of this is that you need to call getValues slightly differently, here's a snippet of code that I wrote for a recent site:&lt;br /&gt;&lt;br /&gt;[code]&lt;br /&gt;    function Items($limit = 3) {&lt;br /&gt;      if(!$this-&amp;gt;Link) return 0;&lt;br /&gt;      $feed = new RestfulService($this-&amp;gt;Link);&lt;br /&gt;      $feedXML = $feed-&amp;gt;request()-&amp;gt;getBody();&lt;br /&gt;&lt;br /&gt;      // Extract items from feed&lt;br /&gt;      if($this-&amp;gt;Type == 'RSS2') {&lt;br /&gt;        $result = $feed-&amp;gt;getValues($feedXML, 'channel', 'item');&lt;br /&gt;      } elseif($this-&amp;gt;Type == 'RSS1') {&lt;br /&gt;        $result = $feed-&amp;gt;getValues($feedXML, 'item');&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      // Return items up to limit&lt;br /&gt;      return $result-&amp;gt;getRange(0,$limit);&lt;br /&gt;    }&lt;br /&gt;[/code]&lt;br /&gt;&lt;br /&gt;Hope that helps.&lt;br /&gt;&lt;br /&gt;BTW I've posted a patch to Trac that re-enables the response caching as I couldn't live without it for this site. Not sure whether it's good enough for inclusion in trunk though.&lt;br&gt;&lt;br&gt;Posted to: restful service rss</description>
			<pubDate>Mon, 01 Dec 2008 21:35:43 +1300</pubDate>
			<author>Jamie Neil</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=240843</guid>
		</item>
		
		<item>
			<title>Re: restful service rss</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=240568</link>
			<description>I have the same problem as superautomatic. Got it working as described in [url=http://doc.silverstripe.com/doku.php?id=restfulservice#how_to_use_restfulservice_to_easily_embed_an_rss_feed]the documentation[/url], with help from the comments. But it only works with that feed, none else. &lt;br /&gt;&lt;br /&gt;I can't seem to get the http://mypage/PageComment/rss/ feed working either. It says that Xml- or textdeclaration not in beginning of entity. Any clues on that?&lt;br /&gt;&lt;br /&gt;Besides that there is a typo in RestfulService.php, in line 134. $respnoseBody should be $responseBody I suppose. &lt;br&gt;&lt;br&gt;Posted to: restful service rss</description>
			<pubDate>Mon, 01 Dec 2008 08:30:04 +1300</pubDate>
			<author>Andreas Sundström</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=240568</guid>
		</item>
		
		<item>
			<title>Re: restful service rss</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=89906</link>
			<description>The blog modules RSS Feed widget uses SimplePie. I dont know how it differs from RestFulService it terms of what you actually want to do but that uses something like&lt;br /&gt;&lt;br /&gt;http://pastie.org/212736&lt;br /&gt;&lt;br&gt;&lt;br&gt;Posted to: restful service rss</description>
			<pubDate>Wed, 11 Jun 2008 13:58:47 +1200</pubDate>
			<author>Will Rossiter</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/89336?showPost=89906</guid>
		</item>
		
		<item>
			<title>restful service rss</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/89336</link>
			<description>Hi, I'm trying to import and display an external rss-feed, as in the example code on &quot;How to use RestfulService to easily embed an RSS feed&quot; (http://doc.silverstripe.com/doku.php?id=restfulservice)&lt;br /&gt;&lt;br /&gt;It works well if I use the rss feed in the example, but if I use another rss (for example http://www.euro2008.uefa.com/rss/index.xml), it returns nothing at all. Why is this?&lt;br&gt;&lt;br&gt;Posted to: restful service rss</description>
			<pubDate>Tue, 10 Jun 2008 21:33:10 +1200</pubDate>
			<author>Jens Hellqvist</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/89336</guid>
		</item>
		

	</channel>
</rss>
