Menu Close

All Africa News

All Africa News

set_favicon_handler(‘handler_image.php’);

// Cache files location
// $feed->set_cache_location(‘/cache/cache’);

// Initialize the feed object
// $feed->init();

// This will work if all of the feeds accept the same settings.
// $feed->handle_content_type();

// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn’t change it).
// $feed->handle_content_type();
?>
set_feed_url(‘http://allafrica.com/tools/headlines/rdf/africa/headlines.rdf’ );
$feed->force_feed(true);
$feed->init();
$feed->handle_content_type();
// echo $feed->get_title();

$feed->set_item_limit(18);

// Loop the results
foreach($feed->get_items() as $item) {

// echo $item->get_title();
// echo ‘


‘;

} // specify the rss feed

$limit = $feed->get_item_quantity(9); // specify number of items
$items = $feed->get_items(0, $limit); // create an array of items
}
if ($limit == 0) echo ‘

The feed is either empty or unavailable.

‘;
else foreach ($items as $item) : ?>
get_image_link()){
$feed->handle_content_type();
echo ‘get_date(‘j F Y’); ?>
get_content()). ‘”/>’; ?>
get_description(), 0, 100); ?> …
Source:

*********