hola... si todavia no lo resolviste tal vez esto te podria ayudar
Código PHP:
Ver original<?php
class RssReader {
var $url;
var $data;
function RssReader ($url){
$this->url;
}
function get_items (){
foreach ($matches[0] as $match){
$items[] = new RssItem ($match);
}
return $items;
}
}
class RssItem {
var $title, $url, $description,$img;
function RssItem ($xml){
$this->populate ($xml);
}
function populate ($xml){
preg_match ("/<title> (.*) <\/title>/xsmUi", $xml, $matches); $this->title = $matches[1];
preg_match ("/<link> (.*) <\/link>/xsmUi", $xml, $matches); $this->url = $matches[1];
preg_match ("/<description> (.*) <\/description>/xsmUi", $xml, $matches); $htmlDescription = $matches[1];
preg_match ("/src=\" (.*) \"/xsmUi", $htmlDescription, $matches);//buscamos la url de la imagen $this->img = $matches[1];
preg_match ("/<p> (.*) <\/p>/xsmUi", $htmlDescription, $matches);//buscamos la descripcion de la noticia $this->description = $matches[1];
}
function get_title (){
return $this->title;
}
function get_url (){
return $this->url;
}
function get_description (){
return $this->description;
}
function get_img (){
return $this->img;
}
}
//puede haber problemas con la codificacion... resolver con iconv('UTF-8', 'ISO-8859-1',$cadena)
?>
es la misma clase que utilizaste o encontraste... le agregue algo mas para que saque la url de la imagen que viene en <description></description>.. OJO esto lo que hace es buscar cualquier cadena que este entre
src=" " ..
ejemplo de <description>
Código HTML:
Ver original<description>
<![CDATA[
<img src="images/imagen.jpg">
<p>descripcion, noticia o lo que sea</p>
]]>
</description>
Esta fue la estructura en el cual me base para hacer el codigo...