Welcome to WebmasterWorld Guest from 54.226.67.166

Forum Moderators: bill & werty

Message Too Old, No Replies

Magpierss simple

magpierss xml rss feed simple

     

baron13

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

10+ Year Member



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]

baron13

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

10+ Year Member



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

Regards,
Baron

Jordo needs a drink

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

5+ Year Member



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.

baron13

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

10+ Year Member



And how can I output the testfile?

baron13

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

10+ Year Member



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]

Jordo needs a drink

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

5+ Year Member



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.

baron13

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

10+ Year Member



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

Featured Threads

Hot Threads This Week

Hot Threads This Month