21306 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 806 Views |
-
Issue with RSSFeed, RestfulService and getValues

27 August 2010 at 3:08pm
Howdy
I'm using RestfulService to get RSS feeds from internal website to integrate into our website:
function RestfulLinks($url, $delimiter, $interval){
$rssfeed = new RestfulService($url,$interval);
$conn = $rssfeed->request('')->getBody();
$result = $rssfeed->getValues($conn, $delimiter);
return $result;
}This work for Atom feeds using "entry" as a delimiter like this one: http://itson.co.nz/feeds/all/
But when I try to use it to access a bog standard RSS feed using "item" as delimiter it fails. Here's an example (Silverstripe) feed it's failing on: http://www.nelsontasmancivildefence.co.nz/news/rss
The RSS feeds are coming through fine and if I use "channel" as a delimiter it pulls through the channel information.
This would suggest that the problem is around
getValues($conn, $delimiter)
Does anyone have any ideas why this would be happening? I'm on SS2.4
Cheers
Tama -
Re: Issue with RSSFeed, RestfulService and getValues

31 August 2010 at 8:35am
A bit of a bump here.
Am I the only person who's run into this issue?
-
Re: Issue with RSSFeed, RestfulService and getValues

22 September 2010 at 11:55am
I found the problem. I had based my code on this example: http://doc.silverstripe.org/restfulservice#how_to_use_restfulservice_to_easily_embed_an_rss_feed
However getValues() has been updated and now takes 3 values instead of 2: http://api.silverstripe.org/2.4/sapphire/integration/RestfulService.html#methodgetValues
So the correct line is:
$result = $rssfeed->getValues($conn, 'channel', $delimiter);
ARGH!!!!!
-
Re: Issue with RSSFeed, RestfulService and getValues

13 October 2010 at 7:39am
I've been using Google's API and I am able to use it in the editor.
| 806 Views | ||
|
Page:
1
|
Go to Top |


