homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

Parsing Google News feeds
How to reformat google descriptions?

 10:38 am on Mar 4, 2006 (gmt 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)

thou shalt not steal


 6:11 pm on Mar 5, 2006 (gmt 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)

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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved