4 * Copyright 2010 Sébastien Le Callonnec
6 * This file is part of PhpWiki.
8 * PhpWiki is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * PhpWiki is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 * @author: Sébastien Le Callonnec
25 require_once 'lib/WikiPlugin.php';
26 require_once 'lib/AtomParser.php';
28 class WikiPlugin_AtomFeed
36 function getDescription()
38 return _('Atom Aggregator Plugin');
41 function getDefaultArguments()
52 function run($dbi, $argstr, &$request, $basepage)
54 extract($this->getArgs($argstr, $request));
55 $parser = new AtomParser();
58 $parser->parse_url($url);
63 foreach ($parser->feed as $feed) {
64 $title = HTML::h3(HTML::a(array('href' => $feed["links"]["0"]["href"]), $feed["title"]));
66 foreach ($parser->entries as $entry) {
67 $item = HTML::dt(HTML::a(array('href' => $entry["links"]["0"]["href"]), $entry["title"]));
68 $items->pushContent($item);
71 $description = HTML::dd(HTML::raw(html_entity_decode($entry["content"])));
73 $description = HTML::dd();
75 $items->pushContent($description);
77 if ($maxitem > 0 && $counter >= $maxitem) {
82 $html = HTML::div(array('class' => 'rss'), $title);
83 $html->pushContent($items);