Created
April 12, 2013 07:28
-
-
Save samsonasik/5370196 to your computer and use it in GitHub Desktop.
using simplepie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. copy to vendor folder. | |
2. edit index.php | |
chdir(dirname(__DIR__)); | |
// Setup autoloading | |
require 'init_autoloader.php'; | |
//require the simplepie | |
require './vendor/SimplePie/autoloader.php'; | |
// Run the application! | |
Zend\Mvc\Application::init(require 'config/application.config.php')->run(); | |
3. test it! call from controller : | |
public function indexAction() | |
{ | |
$feed = new \SimplePie(); | |
$feed->set_feed_url('feed://samsonasik.wordpress.com/feed'); | |
$feed->set_item_class(); | |
$feed->enable_cache(true); | |
$feed->set_cache_duration(3600); | |
$feed->set_cache_location('./data/cache'); | |
$feed->init(); | |
$feed->handle_content_type(); | |
\Zend\Debug\Debug::dump($feed->get_items()); | |
die; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment