https://github.com/loadsys/cakephp-rss-datasource
Helps reading RSS feeds in CakePHP as if it were a model.
https://github.com/loadsys/cakephp-rss-datasource
Last synced: 9 months ago
JSON representation
Helps reading RSS feeds in CakePHP as if it were a model.
- Host: GitHub
- URL: https://github.com/loadsys/cakephp-rss-datasource
- Owner: loadsys
- Created: 2010-09-06T19:25:19.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2014-02-06T23:24:04.000Z (almost 12 years ago)
- Last Synced: 2025-04-04T20:51:24.227Z (10 months ago)
- Language: PHP
- Homepage: http://blog.loadsys.com/2009/06/19/cakephp-rss-feed-datasource/
- Size: 169 KB
- Stars: 17
- Watchers: 11
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
## Installation
cd your_app_name/Plugin/
git clone git@github.com:loadsys/CakePHP-RSS-Datasource.git Rss
You may optionally want to add it as a submodule instead of the clone command above.
git submodule add git@github.com:loadsys/CakePHP-RSS-Datasource.git Rss
Also, add the following line to your bootstrap.php.
CakePlugin::load('Rss');
## Usage
The values shown below under the Optional comment will be set to the values you see there if they are left out. The required options must exist. If you wish, you can make different database config property for each different feed you would like to work with. The feedUrl is an optional parameter that will be used by default if it is not set in the model.
'Rss.Rss',
'database' => false,
/** Optional **/
'feedUrl' => 'http://feedurl',
'encoding' => 'UTF-8',
'cacheTime' => '+1 day',
);
}
?>
Inside of each model that will consume an RSS feed, change the $useDbConfig property to the appropriate feed property from the database.php file. If you are instead using a single database config property, you would set the feed url in the model. The public $feedUrl is read before a read, and takes priority over the feedUrl set in the database config property.
Then in your controller that uses the model, simply use the $this->Model->find('all');
Feed->find('all');
$this->set(compact('feeds'));
}
}
?>
## Reference
Original blog post: http://blog.loadsys.com/2009/06/19/cakephp-rss-feed-datasource/