Php 保存外部rss源的最简单方法

Php 保存外部rss源的最简单方法,php,cakephp,rss,external,Php,Cakephp,Rss,External,我有一个大问题,我想从mydealz.de读取rss提要,并将它们的标题、内容和日期保存到我的数据库中。我使用的是cakephp,有没有简单的方法?我简直没有主意了 我试图从本教程中做到这一点:但在模型中,我声明我没有使用数据库 App::import('Core', 'HttpSocket'); $HttpSocket = new HttpSocket(); $input = $HttpSocket->get('http://www.example.com/something.xml')

我有一个大问题,我想从mydealz.de读取rss提要,并将它们的标题、内容和日期保存到我的数据库中。我使用的是cakephp,有没有简单的方法?我简直没有主意了

我试图从本教程中做到这一点:但在模型中,我声明我没有使用数据库

App::import('Core', 'HttpSocket');
$HttpSocket = new HttpSocket();
$input = $HttpSocket->get('http://www.example.com/something.xml');

App::import('Xml'); 
$xml = new Xml($input);
$xmlAsArray = $xml->toArray();

foreach($xmlAsArray as $item) {
    $this->Article->create();
    $data['Article'] = array(
        'title' => $item['title'],
        'contents' => $item['contents'],
        'date' => $item['date']
    );
    $this->Article->save($data);
}