From: Martin Y. C. <so...@ba...> - 2003-07-06 22:16:19
|
Hi, After surfering web for a while, I found a good class for read RSS from internet and seems works well with PhpWiki.. May it be the plugin in next release ? The rss parser is at http://magpierss.sourceforge.net/ Below is a simple demo ( <table> is better IMO ) which produce a simple rss summary. require('magpierss/rss_fetch.inc'); function run($dbi, $argstr, $request) { extract($this->getArgs($argstr, $request)); $rss = fetch_rss($url); $html = new HTML('p'); $html->pushContent( HTML::strong( HTML::a(array('href' => $rss->channel['link']), $rss->channel['title'] ) ) ); $cont = new HTML('ul'); foreach ($rss->items as $item ) { $link = HTML::li(HTML::a(array('href' => $item['link']), $item['title'])); $cont->pushContent($link); } $html->pushContent($cont); return $html; } -- -sothat |