, (*1)
Description
A SimplePie wrapper-class for generating objects that can be used to render a RSS feed. This wrapper-class comes prebundled with a version of SimplePie. For more information on SimplePie, visit http://simplepie.org/, (*2)
Installation
Download, (*3)
To download CRssFeed you can either add it as a dependency in your composer.json like so:, (*4)
"require": {
"edax/crssfeed": "dev-master"
}
or you can simply download the .zip file and extract it to the desired directory., (*5)
Setup, (*6)
If you are not using the ANAX-MVC framework you can add the CRssFeed class into your project via a simple include. If you've downloaded the .zip file and extracted the "CRssFeed-master" class folder to the same directory as your own working file, then it would look something like this:, (*7)
include('CRssFeed-master/src/Rss/CRssFeed.php');
$rss = new \edax\Rss\CRssFeed(array( url_1, url_2, url,3 ));
Using the ANAX-MVC framework you can include the CRssFeed class like this:, (*8)
$di->setShared('rss', function() {
$rss = new \edax\Rss\CRssFeed(array( url_1, url_2, url,3 ));
return $rss;
});
Remember to provide actual urls to Rss-feeds for the constructor in place of "url_1, url_2, url,3"., (*9)
Feel free to examine rss.php for an example on how to retrive feeds and itterate over the rss object. For a complete list of methods consult the API reference at http://simplepie.org/, (*10)