rss20: Oops! You need to pass a URL!";
return false;
}
/*
Use http object to retrieve raw RSS XML and to cache the data.
*/
$h = new http();
$h->dir = "cache/";
if (!$h->fetch($url, $ttl)) {
/*
The class has a 'log' property that contains a log of events. This log is
useful for testing and debugging.
*/
echo "There is a problem with the http request!";
echo $h->log;
exit();
}
/*
Use xml object to parse the raw RSS XML.
*/
$x = new xml();
if (!$x->fetch($h->body)) {
echo "There was a problem parsing your XML!";
echo $x->log;
exit();
}
/*
Some debugging help.
*/
#echo " ";
#echo $h->log;
#echo " ";
#echo $x->log;
#echo "\n";
#print_r($x->data);
#echo " \n";
/*
Now that we have the RSS data parsed into an object, here is how to work with
it.
*/
#$version = $x->data->RSS[0]->_attr->VERSION;
#$channel_link = $x->data->RSS[0]->CHANNEL[0]->LINK[0]->_text;
#$channel_title = $x->data->RSS[0]->CHANNEL[0]->TITLE[0]->_text;
/*
echo " |