Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Bloge-Feeds

Summary: Blog-like Atom & RSS feeds
Version: 2009-08-11
Prerequisites: PmWiki 2.2.x
Status: beta
Maintainer: Eemeli Aro
Categories: Blog, RSS

Description

This is a wrapper for PmWiki's default WebFeeds that makes the output more blog-like, with full-text or extracted item contents and more robust links & time variables.

Bloge-Feeds is a part of Cookbook.Bloge, but may also be used as a standalone recipe.

To install this recipe:

  • download bloge-feeds.phpΔ to your cookbook directory
  • add the following line to a configuration file:
    include_once("$FarmD/cookbook/bloge-feeds.php");

Usage

Follow the instructions as on PmWiki.WebFeeds, except for including this recipe instead of feeds.php as shown above.

Getting a nice URL for the feed will require a little extra configuration. For example, adding the following in the appropriate per-group customization file (here, local/Blog.php) will give you the ten most recently published pages in the group 'Blog' with names that correspond to the given pattern, at an address such as http://example.org/wiki/Blog?action=atom:

if (($action=='rss') | ($action=='atom')) {
  $FeedPageListOpt = array(
    'name' => '????-??-*',
    'order' => '-ctime',
    'count' => 10
  );
  if (empty($_REQUEST['group'])) $_REQUEST['group'] = 'Blog';
  include_once("$FarmD/cookbook/bloge-feeds.php");
}

Manipulating the $_REQUEST array is required, as feeds.php will check it before reading $FeedPageListOpt.

The full text of a page may be reduced to an extract by adding an anchor [[#jump]] to the page. Bloge-Feeds will replace the line it appears on and any subsequent text with a link "Continue reading..." to the page itself.

Notes

The configuration mentioned above in the usage section is left outside the recipe as it is particular to each use case. Bloge, for instance, also uses this recipe to provide a separate feed for the comments of each blog entry.

The use of the description element to hold the RSS 2.0 feed's full page contents is perhaps not semantically correct, but it should be understood by most feedreaders. The Atom feed of course makes use of the appropriate content element.

For implementing feed autodiscovery, take a look at FeedLinks and RSSFeedLink.

Release notes

See also

  • BlogeA bundle of blogging
  • EnhancedWebFeedsEnhances native PM Wiki Feed support.
  • FeedLinksAdd html-header links for auto-discovery of rss/atom feeds
  • RSSFeedLinkHow to create auto-detect RSS feed links

Contributors

Comments

This space is for User-contributed commentary and notes. Please include your name and a date (eg 2007-05-19) along with your comment. Optional alternative: create a new page with a name like "ThisRecipe-Talk" (e.g. PmCalendar-Talk).

2010-06-16 nikos
I tried the recipe and tested it with Chromium Browser (Chrome), which doesn't support web feeds natively.
Using Googles extension...

 chrome.google.com/extensions/detail/nlbjncdgjeocebhnmkbbbdekmmmcbfjd

to see the rss feed, it said that the feed is no good, and didn't show anything.
Using the extension "RSS Subscriptions with FEED: Handler Support"

 chrome.google.com/extensions/detail/ehojfdcmnajoklleckniaifaijfnkpbi

still for rss, I got this message

  error on line 8 at column 20: Namespace prefix atom on link is not defined
Then I went to "bloge-feeds.php" and completly deleted the following line. 'atom:link' => "<atom:link rel=\"self\" href=\"{\$PageUrl}?action=rss\" />\n",

Now the rss feed shows up fine, but the same as before (the standard pmwiki way).
Apart from the above bug (or whatever), I think that it should be made more clear, from the start,
that this recipie is ment for atom feeds only.

User notes +1: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date
* (-) Optional negative comment. Name, date

These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on June 15, 2010, at 07:43 PM