Skip to content

Commit

Permalink
Merge branch 'demos_feed' of https://github.com/sasezaki/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDotPro committed May 28, 2012
2 parents 24d71f2 + fe502bc commit b3a3294
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions demos/Zend/Feeds/consume-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

use Zend\Loader\StandardAutoloader;
use Zend\Feed\Reader\Reader;

/**
* Consume an RSS feed and display all of the titles and
* associated links within.
*/

/**
* @see Zend_Feed
*/
require_once 'Zend/Feed.php';
require_once dirname(dirname(dirname(__DIR__))).'/library/Zend/Loader/StandardAutoloader.php';
$loader = new StandardAutoloader;
$loader->register();

$feed = Zend_Feed::import('http://news.google.com/?output=rss');

foreach ($feed->items as $item) {
$rss = Reader::import('http://news.google.com/?output=rss');

echo "<p>" . $item->title() . "<br />";
echo $item->link() . "</p>";
foreach ($rss as $item) {

echo "<p>" . $item->getTitle() . "<br />", "\n";
echo $item->getLink() . "</p>";
}

0 comments on commit b3a3294

Please sign in to comment.