[pmwiki-users] pmwiki-2.1.beta14 released, improved RSS and Atom feeds

Patrick R. Michaud pmichaud at pobox.com
Sat Dec 10 17:42:54 CST 2005


I've just released pmwiki-2.1.beta14, which makes significant
changes to PmWiki's built-in web feed capabilities.  The newest
beta release is available from

    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.1.beta14.tgz
    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.1.beta14.zip
    http://www.sourceforge.net/projects/pmwiki
    svn://pmwiki.org/pmwiki/tags/latest

In this new release, the scripts/rss.php file has been replaced by a
newer scripts/rss.php.  Existing sites can either continue to use the
traditional rss.php, or switch over to feeds.php.

The new feeds.php works correctly with UTF-8 and can generate feeds
in any of RSS 2.0, Atom 1.0, RSS 1.0, and even Dublin Core Metadata 
format.  It can also produce feeds from any wikitrail, category, or group,
and supports the use of the RSS <enclosure> tag for podcasting.

To generate feeds, add a line like the following to a local configuration
file:

    if ($action == 'rss') include_once('scripts/feeds.php');
    if ($action == 'atom') include_once('scripts/feeds.php');

The basic functionality of RSS support remains the same as before,
adding ?action=rss or ?action=rdf to a wikitrail page generates a feed
for the pages on the trail.  The ?count=n parameter can be used to
specify the maximum number of items that should be placed in the feed,
while ?order= can specify the order in which items should appear.
Thus:

    http://www.pmwiki.org/wiki/Site/AllRecentChanges?action=rss
      - RSS 2.0 feed for the PmWiki site

    http://www.pmwiki.org/wiki/Category/Skins?action=atom&order=-time
      - Atom 1.0 feed for all pages in the Skins category, most
        recently edited first

    http://www.pmwiki.org/wiki/PmWiki/PmWiki?action=dc
      - Dublin Core Metadata for PmWiki.PmWiki page

The new script is highly configurable, new elements can be easily
added to feeds via the $FeedFmt array.  Elements in $FeedFmt look like

        $FeedFmt['atom']['feed']['rights'] = 'All Rights Reserved';

where the first index corresponds to the action (?action=atom),
the second index indicates a per-feed or per-item element, and
the third index is the name of the element being generated.
The above setting would therefore generate a
"<rights>All Rights Reserved</rights>" in the feed for
?action=atom.  If the value of an entry begins with a '<',
then feeds.php doesn't automatically add the tag around it.
Elements can also be callable functions which are called to
generate the appropriate output.

In order to properly support these changes, PmWiki has also
improved some of its internal metadata handling.  Descriptions,
keywords, and the initial portion of formatted output (up to
$SaveAttrExcerptLength, default 600 chars) are saved directly
into page files.  

Lastly, PmWiki has adjusted the way it saves pages so that
trail markup no longer generates internal links to other pages
on the trail (i.e., trail next and previous links no longer appear
in the link index).

Comments, questions, suggestions welcome as always.

Pm




More information about the pmwiki-users mailing list