diff options
-rw-r--r-- | lib/opmlimporter.php | 22 | ||||
-rw-r--r-- | templates/main.php | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/opmlimporter.php b/lib/opmlimporter.php new file mode 100644 index 000000000..c95df5131 --- /dev/null +++ b/lib/opmlimporter.php @@ -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/>. +* +*/ + diff --git a/templates/main.php b/templates/main.php index fc2631412..ec5a61b35 100644 --- a/templates/main.php +++ b/templates/main.php @@ -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>"; |