зеркало из https://github.com/nextcloud/news.git
create opmlimporter class
This commit is contained in:
Родитель
d8a193119f
Коммит
6e91029b21
|
@ -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>";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче