diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-26 15:14:37 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-26 15:14:37 -0400 |
commit | 6e91029b210cea92adc3534d9d77e008ced6e99d (patch) | |
tree | 16422cd4f8d300cbf0c804ccfb8d96cb6488e2e8 | |
parent | d8a193119f442c92bd47f150d149a5d1caf44a7e (diff) |
create opmlimporter class
-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>"; |