RSS and W3C
Posted: Mon Nov 15, 2004 9:35 am
Okay, I am stuck and need someone to help me out. I read and read and found a partial solution but still need to finish my hairsplitting.
I am syndicating some newsfeeds on my site but I am ceating my site to be W3C compliant, a noble cause
Still I get an ampersand problem and some other tags. This is what I have untill now and I apreciate if someone can give me the last puzzle piece
Basically I need to fix the </a> and other signs. Thnx in advance
I am syndicating some newsfeeds on my site but I am ceating my site to be W3C compliant, a noble cause
Still I get an ampersand problem and some other tags. This is what I have untill now and I apreciate if someone can give me the last puzzle piece
Code: Select all
require_once('rss_fetch.inc');
error_reporting(E_ERROR);
define('MAGPIE_CACHE_ON', 1);
define('MAGPIE_CACHE_DIR', 'cache');
define('MAGPIE_CONDITIONAL_GET_ON', 1);
define('MAGPIE_CACHE_AGE', 10800);
$url = 'http://www.b92.net/news/rss/vesti-naslovi.php';
$max_items = 5;
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, $max_items);
foreach ($items as $item) {
$title = $item[title];
$href = $item[link];
$url = htmlentities($item[link]);
echo "<a href=$url target='_blank'>* $title</a><br>\n";
}
echo "<p>", $rss->channel['title'], "</p>";