homepage Welcome to WebmasterWorld Guest from 54.237.78.165
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

    
Magpierss simple
magpierss xml rss feed simple
baron13

10+ Year Member



 
Msg#: 3143427 posted 10:56 am on Nov 2, 2006 (gmt 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]

 

baron13

10+ Year Member



 
Msg#: 3143427 posted 6:53 pm on Nov 2, 2006 (gmt 0)

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

Regards,
Baron

Jordo needs a drink

5+ Year Member



 
Msg#: 3143427 posted 9:42 pm on Nov 2, 2006 (gmt 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.

baron13

10+ Year Member



 
Msg#: 3143427 posted 1:23 pm on Nov 3, 2006 (gmt 0)

And how can I output the testfile?

baron13

10+ Year Member



 
Msg#: 3143427 posted 1:59 pm on Nov 3, 2006 (gmt 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]

Jordo needs a drink

5+ Year Member



 
Msg#: 3143427 posted 3:00 pm on Nov 3, 2006 (gmt 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.

baron13

10+ Year Member



 
Msg#: 3143427 posted 4:23 pm on Nov 3, 2006 (gmt 0)

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

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