[pmwiki-users] RSS syndication

Eemeli Aro eemeli at gmail.com
Wed Aug 5 14:45:54 CDT 2009


2009/8/5  <pmwiki at 911networks.com>:
> 1. Is there a way of getting the RSS to display the fully rendered
> page? Not just the description.

Yes. I should be releasing a blog recipe package that includes this in
the next few days (hopefully...), but you can use the default
script/feeds.php as well.

RSS2 by itself doesn't actually define an element for the full entry
(same with RSS1, AFAIK), so if you want to use that you'll need to use
the <description> or figure out an extension that works, which I at
least haven't bothered to do. Atom feeds of course have <content>
that's meant for just this.

In any case, just add the following to a config file to make it work.


function FeedText( $pagename, &$page, $tag ) {
  global $ScriptUrl;
  $content = MarkupToHTML($pagename, $page['text']);
  $content = trim(preg_replace(
    array("! class='(?:vspace|urllink|)'!", "!\n</([a-z]+)>\n?!",
	      "! (href|src)='/!"),
    array('', "</$1>\n", " $1='$ScriptUrl/"),
    $content ));
  if ($tag=='content')
    return "<content type=\"html\"><![CDATA[$content]]></content>";
  else return "<$tag><![CDATA[$content]]></$tag>";
}
$FeedFmt['atom']['item']['content'] = 'FeedText';
$FeedFmt['rss']['item']['description'] = 'FeedText';


You may want to make sure that the href and src attributes get propery
adjusted (should be ok, mind), as these links mostly won't be seen
from under your domain.

eemeli



More information about the pmwiki-users mailing list