Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

RSSSimple

Summary: How to create a single blog-like wiki-page with RSS feed
Version: 1.2
Prerequisites: requires at least PmWiki version: unknown. developed with pmwiki-2.0.beta54 and pmwiki-2.1.11; last tested on PmWiki version: pmwiki-2.1.11
Status:
Maintainer:
Categories: RSS

Problem

PmWiki is cool for content, but Dolph wanted a simple solution to create a single blog-like wiki-page with RSS feed.

Solution

You can use rsssimple-1.2.phpΔ to create a valid RSS 2.0 feed of a single page without the need for a wiki-trail.

However, you must use a specific but very easy syntax on the wiki-page.

Sample Syntax of a Main.Blog Site:

    !:: Blog

    Here goes some text. You can describe your blog here, but it will be
    skipped in the feed. Everything depends on level three (!!!) headings.

    Let me explain it a bit more:
    The RSS channel options are defined in the rsssimple.php script. But
    every RSS item is extracted from the wikipage by separating the page
    into chunks between !!! headings. The heading itself will be the
    item-title. Everything up to the next !!! heading will be in the
    item-description.

    The date/time in the heading is also very important. Be sure it matches
    the date given at the beginning of the level 3 heading (see below).

    You can also give a RSS-link like that to your readers: \\
    [[http://www.mysite.com/pmwiki2/pmwiki.php/Main/Blog?action=rsss | RSS-Feed]]


    !!!2005-08-16 22:05 :: blog item 4 [[#a2005-08-16T22:05]]
    Some text that will be shown. The anchor above is for emulating
    the permalink feature of other blogs. You can skip that anchor
    if you like.

    !!!2005-08-16 14:30 :: blog item 3 [[#a2005-08-16T14:30]]
    Another blog entry. Full '''wiki-syntax''' is supported [[Main.HomePage | here]].

    Note, that you can also specify the time if you like.

    !!!2005-08-14 :: blog item 2 [[#a2005-08-14]]
    And another one.

    You can make paragraphs too.

    !!!2005-08-13 :: first blog item [[#a2005-08-13]]
     Welcome to my blog!

Installation

  1. Download rsssimple-1.2.phpΔ
  2. Copy rsssimple-1.2.php to your cookbook directory
  3. Configure the settings in rsssimple-1.2.php
  4. Add to your local/config.php: if ($action == 'rsss') { include_once("cookbook/rsssimple-1.2.php"); }
  5. Enable clean URLs in your local/config.php: $EnablePathInfo = 1;
  6. Create a page with the specific syntax
  7. Test the RSS-Feed by adding ?action=rsss to your sites URL

Older versions

Notes and Comments

Mark Matienzo (26.07.2006):

  • I added support for the guid tag.

Jens Rosenfeld (09.09.2005):

  • For users which use umlauts:
Change this line

### RSS 2.0 definitions
SDV($RssChannelFmt,'<?xml version="1.0"?'.'>

to:

### RSS 2.0 definitions
SDV($RssChannelFmt,'<?xml version="1.0" encoding="iso-8859-1"?'.'>

for international umlauts support.

Hi, I encountered problems with this RSS recipe when reading the feed with Safari browser on MAC. On this browser only the first message of the feed will be displayed. Also the message count displayes an overall count of '1', even though all other readers and browsers I tried display all messages available. On the other hand, other feeds are read correctly by Safari. Anybody who has an idea where to search for an error and how to fix this? --Rico (rt.ux <at> freenet <dot> de), 2007-02-01


RSSSimple works very well. I did have a problem with the anchors, though. They were coming out as "Pagename# - #anchor" until I changed the line that extracts the anchor to this:

       $anchor = str_replace('[[# -> ', '', $anchor[0]);

Also, instead of using "action=rsss" I used "action=rss" because it's less exotic. -- Kaleigh Way (kway at moonrose net), 2007-02-20


Contributors

User notes?: 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 October 10, 2007, at 07:46 PM