Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Parsing Google News feeds

How to reformat google descriptions?

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

New User

10+ Year Member

joined:Mar 3, 2006
votes: 0

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

// 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>'; }
echo '<h2>Error:</h2><p>'.magpie_error().'</p>';

// Restore original error reporting value

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

Junior Member

joined:Feb 4, 2006
votes: 0

thou shalt not steal
6:11 pm on Mar 5, 2006 (gmt 0)

New User

10+ Year Member

joined:Mar 3, 2006
votes: 0


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

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

Preferred Member

10+ Year Member

joined:May 4, 2004
votes: 0

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?


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members