Jump to content

RSS Feed Need help displaying "author"


Guest GreatDebateUSA

Recommended Posts

Guest GreatDebateUSA

Hello all. I'm working on a php script that is displaying a news feed onto my website. I'm using php and it is working just fine. The problem I'm having is that I can't get the author field to display properly. I plugged in the "author" fields (just copied the format from pubDate, description, and link) but instead of seeing the authors name I just see a link back to the original article. I know the authors name is in the feed because if I capture it using a 3rd party's program (like rssfeedreader) I see the author listed. Also, if I look at the feed directly in IE I can see the authors name. According to the site at Harvard Law; http:/ /cyber .law. harvard. edu/rss/rss .html#sampleFiles (why it's there I don't know) "author" should show the authors name and email address in the feed. I don't really want the email address to show and it doesn't show in the rssfeedreader but I would like to get the authors name to show. Should I use a different word besides "author"? When I look at the feeds in IE and then look at the source I do see a field for "author" but I also see one for "atom:name". Both have the authors name after. The code I'm using has two files plus the code that's in my php page, RSSItem.php, RSSIterator.php and the code in my page is as follows.

 

<?php

 

$olderror_reporting =error_reporting(0);

require_once("RSSIterator.php");

require_once("RSSItem.php");

 

try

{

$rss = new RSSIterator("http://feeds.feedburner.com/Realclearpolitics-Articles", 4);

foreach($rss as $item) {

print("

link}\"target=\'_blank\'>{$item->title}

");

print("{$item->pubDate}");

print("

{$item->description}

");

print("{$item->author}

 

 

");

}

}

catch(Exception $e)

{

// here's where do whatever you want to happen if it can't do that, e.g.:

error_log((string) $e);

echo "

RSS feed not available

\n";

}

 

?>

 

Again instead of the authors name, which is all I want I'm getting a link back to the original news article. Any ideas would be greatly appreciated. I've been searching the net for several days trying to figure this one out. Thanks in advance.

 

Jeff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...