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>";