Hello you'se,
I'm using RestfulService to parse in an external RSS feed, just a really simple list of news items with header and a link. On the XML I'm parsing, I have mix of values and attributes. I can get the headers and everything else I need with this snippet of code from RestfulService reference tutorial:
function ParseFeed($url){
$rss = new RestfulService($url);
$conn = $rss->request()->getBody();
$result = $rss->getValues($conn, "entry");
$output = '';
foreach ($result as $key => $value) {
$output .= '<li><a href="'.$value->link.'">'.$value->title.'</a>';
}
return $output;
}
This returns the title but leaves the URL blank -- because it is href attribute on the 'link' node instead of value data. How should I go about getting the href attribute for my links? I suspect I need to use some combination of getValues and getAttributes, but I don't really have any clue how. Any help is highly appreciated!