Pear XML parser finding nothing in ATOM / Movable Type feed

From: Date: Wed, 17 Sep 2008 13:38:08 +0000
Subject: Pear XML parser finding nothing in ATOM / Movable Type feed
Groups: php.general 
Request: Send a blank email to php-general+get-280359@lists.php.net to get a copy of this message
Hi I know nothing about Pear, so I don't know how to debug this: I've got a newly installed Movable Type blog with a couple of entries in it, and I just found from php.net the pear classes to parse an RSS feed, parser.php and rss.php, and this code from the PEAR site works require_once "XML/RSS.php"; $rss =& new XML_RSS("http://rss.slashdot.org/Slashdot/slashdot"); $rss->parse(); echo "<h2>Headlines from slashdot</h2>\n"; echo "<ul>\n"; foreach ($rss->getItems() as $item) { echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></li>\n"; } echo "</ul>\n"; but if I point it at my blog: http://www.bluetreeservices.co.uk/gps_tracking_news/atom.xml or http://www.bluetreeservices.co.uk/gps_tracking_news/ or http://www.bluetreeservices.co.uk/gps_tracking_news , parse returns an empty array. Am I just using the wrong code for that type of feed (I would have thought any RSS reader would handle an atom format feed) or is it that my server needs to provide atom.xml or .. what's going on? I've no idea how to use PEAR::error with regard to $rss->parse() so I'm a bit stumped about debugging it. I'd certainly call myself a PHP programmer, but I've never really used pear is the thing. All help appreciated :-) Cheers J

« previous php.general (#280359) next »