This commit is contained in:
Alessandro Cosentino 2012-05-26 15:14:37 -04:00
Родитель d8a193119f
Коммит 6e91029b21
2 изменённых файлов: 27 добавлений и 1 удалений

22
lib/opmlimporter.php Normal file
Просмотреть файл

@ -0,0 +1,22 @@
<?php
/**
* ownCloud - News app
*
* @author Alessandro Cosentino
* @copyright 2012 Alessandro Cosentino cosenal@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/

Просмотреть файл

@ -4,10 +4,14 @@ $mapper = new OC_News_FeedMapper();
$feed = $mapper->fetch( 'http://algorithmsforthekitchen.com/blog/?feed=rss2' );
echo "<br>" . $feed->getTitle() . "<br>";
$mapper->insert($feed);
$feed = $mapper->find($feed->getId());
$feed = $mapper->findWithItems($feed->getId());
echo "<br>" . $feed->getTitle() . "<br>";
$items = $feed->getItems();
foreach($items as $item) {
echo $item->getTitle();
}
$feed2 = $mapper->findWithItems(45);
echo "<br>" . $feed2->getTitle() . "<br>";