PM Wiki Cookbook Realm

Log In

Main Page

Linux Page

Photo Page

Code Page

Enhanced Feeds Page

Recipe Index

This PmWiKi recipe is for a method to create a blog feed from a group of pages. I have worked to extended my existing code from RSSParser and then enhanced the simple feed support from the native feeds. It allows me to support valid blog feed from my existing PmWiki installation.

Files: Enhanced Feeds 0.1b
Requirements: PHP, PmWiki


Description Tag

The RSS item description tag can be filled with either entire page:

$FeedFmt['rss']['item']['description'] = 'FeedTextPage';

or the first anchored section:

$FeedFmt['rss']['item']['description'] = 'FeedTextSection';

The anchored section is defined by

[[#blog]] ... [[#blogend]],

The anchor tags can be modified by adding a regular expression value:

$BE_PageSection = "/\[\[#blog\]\](.*?)\[\[#blogend\]\]/esi";

Category Tag

The RSS item category tag can be filled with the native PmWiki categories:

$FeedFmt['rss']['item']['category'] = 'FeedCategory';

Sample Config File
## Enable RSS and Atom web feeds.
if ($action == 'rss') {
    include_once($FarmD."/scripts/feeds.php");
    // Load Enhanced Feed script
    include_once($FarmD."/cookbook/EnhancedFeeds.php");
    // Reset Feed tags for Blog feed
    $FeedFmt['rss']['feed']['title'] = $WikiTitle;
    $FeedFmt['rss']['feed']['copyright'] = 'copyright';
    $FeedFmt['rss']['feed']['description'] = 'a description';
    // Reset Item tags for Blog feed
    $FeedFmt['rss']['item']['title'] = '$Title';
    $FeedFmt['rss']['item']['description'] = 'FeedTextSection';
    $FeedFmt['rss']['item']['category'] = 'FeedCategory';
    // Set default values for ?action=rss
    SDVA($_REQUEST, array('group' => 'Blog','order' => '-time','count' => 6,'list' => 'normal','name' => '-SideBar,-HomePage,-Group*,-Flexi*,-Archive*,-Comment*,-Post*'));
}
Sample Wiki Code
(:Title My Blog Entry:)
>>rfloat<<
07-15-2007 - 16:47

''[[{$Name}|Link]] | [[{$Name}Comments|Comments]]''
>><<
!!{$Title}
[[<<]]
[[#blog]]
This is my blog entry...
[[#blogend]]
[[<<]]
----
[[!Blog]]

modified: October 22, 2007, at 07:30 PM