parsing RSS with PEAR XML_RSS
Source code
1
<?php include('./.config.php');
2 require_once "XML/RSS.php";
3 $rss =& new XML_RSS("http://slashdot.org/slashdot.rss");
4 $rss->parse();
5 echo "<h1>Headlines from <a href=\"http://slashdot.org\">Slashdot</a></h1>\n";
6 echo "<ul>\n";
7 var_dump($rss->getItems());
8 //foreach ($rss->getItems() as $item) {
9 // echo '<li><a href="'.$item['link'].'">'.$item['title']."</a><br/>".$item['description']."</li>\n";
10 //}
11 echo "</ul>\n";
12 include('./.footer.php')?>
Output
Warning: require_once(XML/RSS.php) [function.require-once]: failed to open stream: No such file or directory in /home/davidmintz/www/davidmintz.org/php_course/examples/10/pear_rss.php5 on line 2
Fatal error: require_once() [function.require]: Failed opening required 'XML/RSS.php' (include_path='/usr/home/dmintz/inc/pear:.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/davidmintz/www/davidmintz.org/php_course/examples/10/pear_rss.php5 on line 2