Forum Moderators: open

Message Too Old, No Replies

Parsing Google News feeds

How to reformat google descriptions?

         

moneybagsuk

10:38 am on Mar 4, 2006 (gmt 0)

10+ Year Member



Hi there,

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');
?>

mecjfl

12:09 pm on Mar 5, 2006 (gmt 0)



thou shalt not steal

moneybagsuk

6:11 pm on Mar 5, 2006 (gmt 0)

10+ Year Member



eh?

reformatting links in order to send more users to google is hardly stealing is it?

stef25

9:11 pm on Mar 19, 2006 (gmt 0)

10+ Year Member



im wondering about this "stealing issue" too. what if google news stories are also displayed on the site?

is this simply frowned up on for stealing content or a full on copyright violation?