Welcome to WebmasterWorld Guest from 54.146.22.61

Forum Moderators: bill & werty

Message Too Old, No Replies

Magpierss simple

magpierss xml rss feed simple

     
10:56 am on Nov 2, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 15, 2003
posts:96
votes: 0


Hi,
I studied rinceys post at [webmasterworld.com...] .
Very nice post btw. rincey, thank you.
But I can't run my simple test xml project. I need help guys.
I took this xml file: http://www.example.com/xml/note.xml

and wanted to output the heading tag with:

<?
require_once 'rss_fetch.inc';

$url = 'http://www.example.com/xml/note.xml';
//$url = 'http://rss.news.yahoo.com/rss/topstories';
$rss = fetch_rss($url);

foreach ($rss->items as $item ) {
echo $item[heading]."<BR>";
}
?>

But there is only a white screen. No error message, nothing.
When I use the yahoo rss and take description for heading everything runs fine.
Does anybody know why this hapens?

Thanks for your reply guys.

Baron

[edited by: werty at 11:47 pm (utc) on Nov. 11, 2006]
[edit reason] removed specifics from URL - please see TOS #13 [/edit]

6:53 pm on Nov 2, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 15, 2003
posts:96
votes: 0


Come on guys,
is really noone out there who can help me?

Regards,
Baron

9:42 pm on Nov 2, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Jan 14, 2006
posts:222
votes: 0


The feed you are testing with is an xml feed, but not an RSS feed.

Magpie is an RSS feed parser. It's looking for RSS syntax (title, description, url, item, etc), not heading.

It's working for the yahoo feed, because it is an rss feed.

1:23 pm on Nov 3, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 15, 2003
posts:96
votes: 0


And how can I output the testfile?
1:59 pm on Nov 3, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 15, 2003
posts:96
votes: 0


How can I output this file http://www.example.com/xml/cd_catalog.xml
in an HTML table using PHP4? I googled the world and couldn't find an easy to use script. Does someone have a link? Or maybe someone had the same problem in the begining of his xml career ;).

[edited by: werty at 11:46 pm (utc) on Nov. 11, 2006]
[edit reason] removed specifics from URL - please see TOS #13 [/edit]

3:00 pm on Nov 3, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Jan 14, 2006
posts:222
votes: 0


There's a great article on building an RSS parser using PHP on Sitepoint [sitepoint.com ]

I know you need to parse xml, not just rss, so while reading the article, if you choose to do it this way, you would replace the title, item, description, etc tags with the names of the tags you want from your xml file.

Other than that, maybe someone else can help you with a true xml parser.

4:23 pm on Nov 3, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 15, 2003
posts:96
votes: 0


Thank you very much guys. It works. I used the link of Jordo needs a drink.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members