I got it working now, using recycled code from the blog module, as mentioned above:
function LatestSSNews() {
$output = new DataObjectSet();
include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/SimplePie.php'));
$t1 = microtime(true);
$feed = new SimplePie('http://www.silverstripe.org/blog/rss', TEMP_FOLDER);
$feed->init();
if($items = $feed->get_items(0, 2)) {
foreach($items as $item) {
// Cast the Date
$date = new Date('Date');
$date->setValue($item->get_date());
// Cast the Title
$title = new Text('Title');
$title->setValue($item->get_title());
// Cast the description and strip
$desc = new Text('Description');
$desc->setValue(strip_tags($item->get_description()));
$output->push(new ArrayData(array(
'Title' => $title,
'Date' => $date,
'Link' => $item->get_link(),
'Description' => $desc
)));
}
return $output;
}
}
This works ok, I think the way I was trying to do it before was incorrect, I was trying to load it in using the RestfulService class, which didn't seem to work :s.
Mo