Consuming RSS feeds with a datasource
This recipe shows how to get content from remote RSS feeds using a datasource.
Getting ready
We start by installing the fork of CakePHP's datasources plugin. Download the latest release from http://github.com/mariano/datasources/downloads and uncompress the downloaded file into your app/plugins
folder. You should now have a directory named datasources
. The fork used in this recipe uses a refactored version of the RSS datasource developed by Donatas Kairys, member of Loadsys Consulting. This modified version improves the datasource performance, and adds the possibility of changing the feed URL through a find setting. More information about the original datasource can be obtained at http://blog.loadsys.com/2009/06/19/cakephp-rss-feed-datasource.
How to do it...
1. We start by creating a connection to use the RSS datasource. Open your
app/config/database.php
file and add the following connection:public $feed = array( 'datasource' => 'datasources.RssSource...