...

View Full Version : Need help with Yahoo RSS feed - displaying



AshleyQuick
05-29-2004, 06:45 AM
The php code I'm using below is displaying in the following fashion:

Pacers Rip Pistons 83-68 to Even Series (AP)
Indiana's O'Neal Sprains Knee in Game 4 (AP)
Pirates Sweep Doubleheader With Cubs (AP)
Bonds Powers Giants to 7th-Straight Win (AP)

Other, however, display the post date for each headline:

Pacers Rip Pistons 83-68 to Even Series (AP)
5/28/04 10:00 PM
Indiana's O'Neal Sprains Knee in Game 4 (AP)
5/28/04 10:59 PM
Pirates Sweep Doubleheader With Cubs (AP)
5/28/04 11:21 PM
Bonds Powers Giants to 7th-Straight Win (AP)
5/29/04 12:21 AM

...such as the version that is generated here (http://demo.blogharbor.com/blog/_archives/2004/1/10/12913.html).

Can the script I'm using be modified to include the date?


<?php

require('./class.yahoo.php');

$yahoo = new yahoo_news("http://rss.news.yahoo.com/rss/sports", 1);
$news = $yahoo->get_headlines(12);

?>

<?php
for ($i = 0; $i < sizeof($news['title']); $i++) {
echo '<p><img align="absmiddle" src="/art/rss.png" alt="" width="26" height="10" border="0">&nbsp;&nbsp;<a target="_top" href="' . $news['link'][$i] . '">' . $news['title'][$i]. '</a></p>';
}
?>

reubenb
06-02-2004, 12:26 PM
Probably best to put this question into the PHP forum.

AshleyQuick
06-02-2004, 04:01 PM
Could someone please move this to the php forum? :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum