Forum Moderators: open
I'm a newbie to rss in php, and trying to build some custom news feeds from Google News.
I've followed a lot of the advice on this forum, and got news feeds working for bbc etc, using Magpie [magpierss.sourceforge.net...] which is great so far.
But Google news has all sorts of irritating formatting built into its descriptions. So the questions is, how can I customise this?
My current script looks like the below. What would it need to look like to make the Google news links look like a normal one line link headline, one line description?
Help much appreciated
<?php include('rss/rss_fetch.inc');
// Set error reporting for this
error_reporting(E_ERROR);
// Fetch RSS feed
$rss = fetch_rss('http://news.google.co.uk/news?ie=UTF-8&q=asthma+location:uk&output=rss');
if ($rss) {
// Split the array to show first 8
$items = array_slice($rss->items, 0, 8);
// Cycle through each item and echo
foreach ($items as $item )
{echo '<body>'.$item['description'].'</body>'; }
}
else
{
echo '<h2>Error:</h2><p>'.magpie_error().'</p>';
}
// Restore original error reporting value
@ini_restore('error_reporting');
?>