John Greenaway wrote:

Converting Zwiki to RSS format

The code below should display the last 10 wiki changes in RSS format, for use with you own aggregator web pages or standalone readers like http://www.feedreader.com/. To use do the following:

Ok, I set up http://zwiki.org/zwiki.rdf - anyone finding this useful, let us know what you did. Edit annotations are fairly high on the todo list. --SM

Thanks Simon, works quite nicely. Just changed a few of the links in the code that started "www." to start "http://www." to make it valid though cough. --JG

ok, updated --SM


2002/07/02 16:03 GMT (via web):
I find http://zwiki.org/zwiki.rdf useful. Not sure if you should html_quote or similar the title & description nodes. Squishdot rdf fails when a subject line contains an ampersand.


JohnGreenaway 2002/07/02 19:18 GMT (via web):
Added html_quote in various bits, don't know if it helps, certainly doesn't seem to do any harm though. Also fixed the slightly dodgy Catalog line in it too. Only changed the example code above - would need Simon to paste the above into the rdf for this site.


Simon, 2002/07/03 13:43 GMT (via web):
Done.

Although simple to cut and paste the changes, changing the http://zwiki.org and other localized values to dtml-var's and associated properties would make this more easily integrated.

DeanGoodmanson, 2002/12/19 22:49 GMT (via web):
RSS *

New article by Mark Pilgrim: http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html

Lot's of questions...

Should we stick with RDF based (1.0) or move to 2.0 RSS??

What should go into the DESCRIPTION field? Diff?

The language field seems somewhat important..is this available via dtml?

When should ID or Title be used? (My suggestion is same as RecentChanges?)

Is a no-catalog version of this reasonable?

...dtml'izing is critical for use in a SubWiki environment. :-)

RSS method using DTML vars now available --JordanCarswell, 2003/05/25 22:18 GMT
Here's working code for using DTML vars to fill in the localized values used in the RSS feed above. Improvements welcome:

    <dtml-let
         siteurl=absolute_url>

        <?xml version="1.0"?>

        <rdf:RDF 
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://purl.org/rss/1.0/"
        >

        <channel rdf:about="&dtml-absolute_url;">
        <title><dtml-var title_or_id></title>
        <link><dtml-var absolute_url></link>
        <description>
        Recent changes to <dtml-var title_or_id>
        </description>

        <image rdf:resource="&dtml-absolute_url;/images/site_logo.gif" />

        <items>
        <rdf:Seq>
        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <rdf:li resource="&dtml-absolute_url;/&dtml.url_quote-id;" />
        </dtml-in> 
        </rdf:Seq>
        </items>

        <textinput rdf:resource="&dtml-absolute_url;/SearchPage?source=jump" />

        </channel>

        <image rdf:about="&dtml-absolute_url;/images/site_logo.gif">
        <title><dtml-var title_or_id></title>
        <link><dtml-var absolute_url></link>
        <url><dtml-var absolute_url>/images/site_logo.gif</url>
        </image>

        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <item rdf:about="&dtml-absolute_url;/&dtml.url_quote-id;">
        <title><dtml-var title html_quote></title>
        <link><dtml-var siteurl>/<dtml-var id html_quote></link>
        <description>
        <dtml-if last_log><dtml-var last_log><dtml-else>
        This page has been edited by <dtml-var last_editor> on <dtml-var lastEditTime></dtml-if>
        </description>
        </item>
        </dtml-in>

        <textinput rdf:about="&dtml-absolute_url;/SearchPage?source=jump">
        <title>Search <dtml-var title_or_id></title>
        <description>Search <dtml-var title_or_id></description>
        <name>expr</name>
        <link><dtml-var absolute_url>/SearchPage?source=jump</link>
        </textinput>

        </rdf:RDF>

   </dtml-let>

... --JordanCarswell, 2003/05/25 22:22 GMT
I'm not sure what the current method is for checking to find a site logo so that code needs to be fixed by someone who does...

Need Description metadata for Zwiki Pages --JordanCarswell, 2003/05/25 22:47 GMT
For the purposes of using RSSDiscussion, BlogFace, and other methods and products that use a Zwiki's catalog to provide content, every Zwiki pages needs a summary that would be indexed and that describes the intent of the page in a nutshell. For RSS, this could be used for and could be followed by the name of the last editor and date.

html_quote problems --DeanGoodmanson, 2003/05/26 22:14 GMT
Thanks for the work, Jordan. You may want to include the note (or was it log?) field in the description.

Remember that html_quote will not convert "high ascii" to the appropriate escapes and, depending on content, may produce invalid feeds not consumable by strict parsers.

A python function that builds and returns an xmldocument would be the most pure solution...and faster?

dtml-in num vs slice? --DeanGoodmanson, 2003/05/30 15:46 GMT
Just noticed that this:

 <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">

May be more effecient as:

 <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse',num=10)">

dtml-in num vs slice? - update --DeanGoodmanson, 2003/05/30 15:51 GMT
Nope, that would be:

 <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')" size=10>

But not sure if that's any more effecient...

New pages view --DeanGoodmanson, 2003/05/30 15:56 GMT
As this is a primarily power-user feature, a view that has been helpful for managing a wiki has been a "Recent New Pages" list.

this is wonderfully easy by sorting on creation time. RecentChanges? and the RSSDiscussion code can simply change:

 <dtml-in "Catalog(sort_on='lastEditTime' ...

to:

 <dtml-in "Catalog(sort_on='creation_time' ...

And the appropriate UI descriptions.

... --DeanGoodmanson, 2003/05/30 20:52 GMT
Image feed of v. 2.0 needs work :

 <image rdf:resource="&dtml-absolute_url;/images/site_logo.gif" />

It would be nice to be better integrated with overloading the "site_logo" object...as long as it's text based. :-|

RSS w/ DTML Updated Code - JordanCarswell

I think this puts us a little closer to getting it down. I added last_log to come in as the description and perhaps have hacked the correct code for image :

 <dtml-let
 siteurl=absolute_url>

 <?xml version="1.0"?>

        <rdf:RDF 
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://purl.org/rss/1.0/"
        >

        <channel rdf:about="&dtml-absolute_url;">
        <title><dtml-var title_or_id></title>
        <link><dtml-var absolute_url></link>
        <description>
        Recent changes to <dtml-var title_or_id>
        </description>

        <image rdf:resource="
                <dtml-if "_.hasattr(aq_parent,'site_logo')">
                <dtml-with aq_parent><dtml-var site_logo></dtml-with>
                <dtml-else>
                /misc_/ZWiki/ZWikiPage_icon.gif"
                </dtml-if>
        " />

        <items>
        <rdf:Seq>
        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <rdf:li resource="&dtml-absolute_url;/&dtml.url_quote-id;" />
        </dtml-in> 
        </rdf:Seq>
        </items>

        <textinput rdf:resource="&dtml-absolute_url;/SearchPage?source=jump" />

        </channel>

        <image rdf:about="
                <dtml-if "_.hasattr(aq_parent,'site_logo')">
                <dtml-with aq_parent><dtml-var site_logo></dtml-with>
                <dtml-else>
                /misc_/ZWiki/ZWikiPage_icon.gif"
                </dtml-if>
        ">
        <title><dtml-var title_or_id></title>
        <link><dtml-var absolute_url></link>
        <url><dtml-var absolute_url>/images/site_logo.gif</url>
        </image>

        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <item rdf:about="&dtml-absolute_url;/&dtml.url_quote-id;">
        <title><dtml-var title html_quote></title>
        <link><dtml-var siteurl>/<dtml-var id html_quote></link>
        <description>
        <dtml-if last_log><dtml-var last_log><dtml-else>
        New contributions have been made by <dtml-var last_editor html_quote> on 
        <dtml-var lastEditTime  html_quote></dtml-if>
        </description>
        </item>
        </dtml-in>

        <textinput rdf:about="&dtml-absolute_url;/SearchPage?source=jump">
        <title>Search <dtml-var title_or_id></title>
        <description>Search <dtml-var title_or_id></description>
        <name>expr</name>
        <link><dtml-var absolute_url>/SearchPage?source=jump</link>
        </textinput>

        </rdf:RDF>

 </dtml-let>

Not quite there... - JordanCarswell

I just noticed that I left the url tag for the image out. How would you dtml-ize this? The image could be anywhere... :

 <url><dtml-var absolute_url>/images/site_logo.gif</url>

Heads up SubWiki users! --DeanGoodmanson, 2003/06/10 14:27 GMT
After recatalogging a root wiki, the RecentChanges? is appropriate, but this RSS includes pages from the SubWiki's (because catalog's grab everything at their node and below, and due to a difference in RecentChanges? and this code..the most of which I can only tell is that the parameters in RecentChagnes? are passed in as DTML parameters, not to the Catalog function.

subtopics:


comments:

RSS 2.0? --DeanGoodmanson, 2003/06/16 04:51 GMT reply
Jordan: What do you use for an RSS reader? Feedreader is messy with RDF, and a true RSS form would be nice (and possibly quicker due to single pass) .. for a start this may help: http://nomad.freezope.org/weblog/1041236091 <-- currently down due to Squishdot strip-o-gram content munger. I'm currently swamped.

zwiki.rdf updated --SimonMichael, 2003/07/24 22:22 GMT reply
Here's a corrected (?) version of the above, at least mozilla parses it. Note you'll have to remove the space before the xml tag if you use this (and, isn't a closing xml tag needed ?):

 <dtml-let siteurl=absolute_url>

 <?xml version="1.0"?>

        <rdf:RDF 
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://purl.org/rss/1.0/"
        >

        <channel rdf:about="&dtml-siteurl;">
        <title><dtml-var title_or_id></title>
        <link><dtml-var siteurl></link>
        <description>
        Recent changes to <dtml-var title_or_id>
        </description>

        <image rdf:resource="
                <dtml-if "_.hasattr(aq_parent,'site_logo')">
                <dtml-with aq_parent><dtml-var site_logo></dtml-with>
                <dtml-else>
                /misc_/ZWiki/ZWikiPage_icon.gif"
                </dtml-if> 
        />

        <items>
        <rdf:Seq>
        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <rdf:li resource="&dtml-siteurl;/&dtml.url_quote-id;" />
        </dtml-in> 
        </rdf:Seq>
        </items>

        <textinput rdf:resource="&dtml-siteurl;/SearchPage?source=jump" />

        </channel>

        <image rdf:about="
                <dtml-if "_.hasattr(aq_parent,'site_logo')">
                <dtml-with aq_parent><dtml-var site_logo></dtml-with>
                <dtml-else>
                /misc_/ZWiki/ZWikiPage_icon.gif"
                </dtml-if>
        >
        <title><dtml-var title_or_id></title>
        <link><dtml-var siteurl></link>
        <url><dtml-var siteurl>/images/site_logo.gif</url>
        </image>

        <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
        <item rdf:about="&dtml-siteurl;/&dtml.url_quote-id;">
        <title><dtml-var title html_quote></title>
        <link><dtml-var siteurl>/<dtml-var id html_quote></link>
        <description>
        <dtml-if last_log><dtml-var last_log><dtml-else>
        New contributions have been made by <dtml-var last_editor html_quote> on 
        <dtml-var lastEditTime  html_quote></dtml-if>
        </description>
        </item>
        </dtml-in>

        <textinput rdf:about="&dtml-siteurl;/SearchPage?source=jump">
        <title>Search <dtml-var title_or_id></title>
        <description>Search <dtml-var title_or_id></description>
        <name>expr</name>
        <link><dtml-var siteurl>/SearchPage?source=jump</link>
        </textinput>

        </rdf:RDF>

 </dtml-let>

I've installed this at /zwiki.rdf (should I call it zwiki.rss ?) and linked on the front page. I have a feeling this may not be right yet though. How do I view an RSS feed, anyhow ?

fix --SimonMichael, 2003/07/24 22:32 GMT reply
Ah, that's better.. fixed the urls.

Reading RSS feed with sharpreader --PieterB, Mon, 15 Sep 2003 11:11:26 -0700 reply
I'm trying to read Zwiki using the Sharp reader aggregator. Some remarks on /zwiki.rdf:

Are people using the feed? I think of extending the RSS feed a bit, and I am wondering if people use the zwiki feed at this moment.

PieterB

Reading RSS feed with sharpreader --DeanGoodmanson, Mon, 15 Sep 2003 11:57:40 -0700 reply
I've found SharpReader? not the best companion to RDF feeds. Looking forward to an RSS 2.0 version (which can be done similar to this, except with the caveat of defining certain fields and the whole xml_quote things) For a grandiose dream see: http://www.pycs.net/sqr/2003/09/14.html#a153

The icon may be a relative URL? SharpReader? doesn't attempt to get those.

The feed is useful as a RecentPages moniter.

Reading RSS feed with sharpreader --Simon Michael, Tue, 16 Sep 2003 15:35:02 -0700 reply
PieterB wrote:

- It validates! (see

Woohoo!

Are people using the feed? I think of extending the RSS feed a bit, and I am wondering if people use the zwiki feed at this moment.

I'm pretty sure it would be a popular feature if you fixed it up, since those RSS buttons are everywhere. What advantages it would have over email.. I don't know enough about it.

Reading RSS feed with sharpreader --DeanGoodmanson, Tue, 16 Sep 2003 16:58:14 -0700 reply
Erps! I was thinking FeedReader? when I responded about SharpReader?.

Sam Ruby's recent RSS presentation --SimonMichael, Thu, 18 Sep 2003 15:11:05 -0700 reply
http://www.intertwingly.net/slides/2003/seybold/

courtesy of the excellent http://ongoing.net .

Catalog? --WaltLudwick, Sat, 20 Sep 2003 09:10:31 -0700 reply
I'm having trouble getting this (http://zwiki.org/zwiki.rdf/view_source - the version that validates for sure) code to work. Per instructions above, i created a dtml method called "zwiki.rdf" in my zwiki folder, pasted in this code... no joy, my aggregator (NetNewsWire?) shows a 503 error (service unavailable) at what should be the address of the feed (localhost:8500/Plone/wiki/zwiki.rdf - nested in a Plone, obviously, but i don't know why that should matter). Now i'm wondering if i've got to do something else to make this work - something to do with this "Catalog" line? I created a ZCatalog called "Catalog", but that didn't do it (dunno what if anything to do with this ZCatalog, as i've never used one before). Tips as to what i might do to make this work would be most appreciated!

Catalog? --DeanGoodmanson, Sat, 20 Sep 2003 17:07:57 -0700 reply

  1. What version of zwiki? ZWiki-0-22-0rc5 |/|/
  2. How did you install the catalog? (short version, which version of ZwikiAndZCatalog?) i don't understand the options. see comment below |/|/
  3. Feel free to post a traceback from the test URL of your site, simiilar to http://zwiki.org/zwiki.rdf wish i could, but it's offline, on my local machine - which should be online soon as the ISP comes thru w/ the promised DSL |/|/

I think your catalog might be incomplete, .rdf method might contain one of them obscure through a typo dtml-errors, or .

BTW all, Has using Zwiki's recent changes through rdf/rss been useful for you? Any thoughts on how to incorporate content (beyond the last_log/subject/note) message? Simon's recent "New" notation might be useful.
it has indeed been useful to me, for keeping up w/ changes on this wiki. I do wish i could get a bit more of the news in the RSS blurb (i.e. "Heads/ Decks/ Leads," as the old-school journalists put it), but i don't know how you do that without writing a separate summary in the "note" field. |/|/

A friend recently interpreted rss lists in a "changes last time period" instead of "last n changes", what's your preference? (mine, and this implementation) is the latter.
Hm, interesting alternative. I can see the benefit of having changes since i last downloaded (if that's what in fact it does), but if that implies a very long result set, then i can also see the benefit of having a default cutoff point. Ideal might be if it were like "all changes since i last logged in, to a limit of n posts," IMHO. |/|/

Catalog? --WaltLudwick, Sun, 21 Sep 2003 02:35:01 -0700 reply
Hey, Dean: Thanks for the timely info. But i'm still stuck at the basics, i.e. Is it true that this dmtl method for rdf does not work unless you first build a ZCatalog? If so, then what is the easiest way to do that (presuming it's just for this, and we don't care about Tracker or optimization or debugging or any of that stuff on ZwikiAndZCatalog page), step-by-step? I realize this is not a Zope/ZCatalog support forum, so i'll try to discover this via more appropriate channels, but any relevant link(s), and certainly an answer to the first question, might be in order here. Thanks again!

... --DeanGoodmanson, Sun, 21 Sep 2003 14:24:52 -0700 reply

this dmtl method for rdf does not work unless you first build a ZCatalog?

You'll have to go through all the steps on teh ZwikiAndZCatalog page step by step, and skip the tracker fields/indexes/metadata/etc., then be sure to search for all Zwiki Pages when your done to populate the tracker. I may be missing something...I've been slow to accomplish teh same task on my home computer this week due to holding out then fighting with the script. By hand originally took me @ 20 minutes typing & re-checking.

rss2 -- Sun, 21 Sep 2003 21:55:29 -0700 reply
Arg! I realize how much I rely on Zwiki's built-in DTML page helpers!

Tonight I scraped together a working, although far from perfect and untested, RSS 2.0 feed. Please give it a whirl, tweek it (in some places you'll have to, such as time-zone). It requires a catalog but only makes one pass. rss2, I couldn't figure out how to make the zwiki page work as a dtml-method. (in a similar vien to a zwiki page doubling as a StyleSheet? )

After glancing through the latest RecentChanges? I'm sure these features would make for a more appropriate integration. html_quote is far from exhaustive, also, and certain characters won't be converted (such as curly quotes, em-dashes, etc.) and only building a pure xml-document seems to be the solution to that one.

rss2 --Simon Michael, Tue, 23 Sep 2003 00:16:42 -0700 reply
RSS2 ? Sounds good.. I hid the wiki header & footer on that page. Maybe that's enough to make it usable.

From 0.22 on, instead of Catalog( try using pages(. This accepts the same arguments but will work regardless of the catalog's id, will work in a cmf/plone site, and might work in non-cataloged wikis too.

As well as last_log, there's a recently added summary field (eg the summaries in RecentChanges?).

rss2 --DeanGoodmanson, Wed, 24 Sep 2003 08:56:00 -0700 reply
Thanks. Now SubTopics? are creaping in.

rss2 --Simon Michael, Wed, 24 Sep 2003 09:15:27 -0700 reply
Ah. I've turned them off in the edit form for now. So does this work in an RSS reader ?

rss2 --DeanGoodmanson, Wed, 24 Sep 2003 09:28:14 -0700 reply
Getting there! :-) Now the page is wrapped in a <p> tag.

rss2 --DeanGoodmanson, Thu, 02 Oct 2003 07:43:48 -0700 reply
The feed is in place, but the object names are all wrong.

rss for a page --DeanGoodmanson, Thu, 02 Oct 2003 07:48:08 -0700 reply
With the new style comments I believe I have enough information to make an RSS feed out of a page, except for one thing: Tracking the last change on the Document part.

Main Scenario: Document is edited. All the information is there as the last change information is stored for the document in the page properties and the comments have their header.

Exception: Comment is added. The last change information reflects the last comment info, not the document info.

Solution: A property that holds a header style change information for the document, or that that information is tucked into the document but never displayed (or included in comment tags).

rss2 dtml method hack --BillSeitz, Tue, 25 Nov 2003 19:58:48 -0800 reply
I'm about to try and paste in the body of a dtml-method I just implemented to do an rss2 feed. It includes item values: author, pubDate, etc. For pages with id starting with z (my WikiLog? hack) it includes a chunk of the raw page content, just as the StructuredText, no rendering to HTML. Hope someone finds it helpful...

body:

 <?xml version="1.0"?>
 <rss version="2.0">
   <channel>
     <title><dtml-var "aq_parent.title" html_quote></title>
     <link><dtml-var "aq_parent.absolute_url()">/FrontPage</link>
     <description><dtml-var "aq_parent.title" html_quote></description>
     <language>en-us</language>
 <dtml-try>
 <!-- using catalog search -->
 <dtml-in Catalog sort=lastEditTime reverse size=20>
     <item>
       <title><dtml-var "id" html_quote></title>
       <link><dtml-var "URL1">/<dtml-var "id"></link>
       <dtml-if "id[0] == 'z'">
       <description><dtml-let 
 page="getObject()"
 text="page.text()[0:200]"
 >
 <dtml-var expr="text" html_quote></dtml-let></description>
       <dtml-else>
       <description><dtml-var last_log html_quote></description>
       </dtml-if>
       <pubDate><dtml-var lastEditTime fmt="%a, %d %b %Y %H:%M:%S +0000"></pubDate>
       <author><dtml-var last_editor html_quote></author>
       </item>
 </dtml-in>
 <dtml-except>
 <!-- not using catalog search -->
 <dtml-in "aq_parent.objectValues(spec='ZWiki Page')" sort=lastEditTime reverse size=20>
     <item>
       <title><dtml-var "id()" html_quote></title>
       <link><dtml-var "aq_inner.aq_parent.absolute_url()">/<dtml-var "id()"></link>
       </item>
 </dtml-in>
 </dtml-try>
     </channel>
 </rss>

Works for me -- Mon, 22 Dec 2003 13:18:30 -0800 reply
Thanks Bill. I edited the if statement and let every page bring back a description. This is gonna make it easy to stay upto date with out site. (it an internal site of no interest to others)

The RSS 1.0 code works for me but not the RSS 2.0 version -- Wed, 24 Dec 2003 02:43:21 -0800 reply
The zwiki.rdf code posted above by SimonMichael on 2003/07/24 22:22 works fine for me. I just added the needed encoding attribute in the opening xml tag (encoding="UTF-8") in work to make it nicer. And I named this DTML Method "rss1.0" instead of zwiki.rdf. This way, I can easily get an RSS 1.0 feed of any of my SubWikis? with this kind of URL : http://www.mysite.toto/wikis/team-one/rss1.0 or http://www.mysite.toto/wikis/team-two/rss1.0. But the RSS 2.0 code posted above by BillSeitz on Tue, 25 Nov 2003 19:58:48, does not work fine : it just displays an empty feed unless I put the method into one of the subwiki and even then it does not display the recent changes of the given subwikis but instead the recent changes of the above folder... tricky... What would be very nice would be to make the latest diff made in the changed page visible from within the feed. The RSS 1.0 now displays message such as

WikiPage? New contributions have been made by UserName? on 2003/10/15 11:55:40 GMT+2
It would be so cool if it displayed :
WikiPage? New contributions have been made by UserName? on 2003/10/15 11:55:40 GMT+2 : -deleted : I feel bad ! +added : I feel better now !
or something like that.

Thanks for your code !

-- Sig ( http://sig.levillage.org/ )

The RSS 1.0 code works for me but not the RSS 2.0 version --DeanG, Sat, 27 Dec 2003 08:18:33 -0800 reply
Did you try RSS2 ?

... --Sig, Mon, 29 Dec 2003 05:22:03 -0800 reply
I tried RSS2. It is nice but is not perfect.

In order to get the DTML source of this page, I had to edit it and view source (because ePoz hides it...). Eventually, I pasted it into my wiki site (running ZWiki 0.18 on Zope 2.6.2) as a DTML Method. Zope complained once or twice about the dtml-call and dtml-in lines not having double quotes around their attributes (the expression called). I also had to replace the dtml-var Title by a dtml-var title_or_id since Title was not resolved. And I eventually had to replace your call to "pages()" by a call to Catalog () (I did not understand the comment). This way it runs properly in my setup. Here is the code

Actually, it runs. But it still lacks the ability to display the diff within the description of the RSS item (I have to click on diff in order to see it). And, by the way, I prefer sticking to RDF with RSS1.0 but this is rather a matter of faith, so...

Can I paste the resulting RSS2.0 DTML method below ? Here it comes :

 <dtml-call "REQUEST.set('bare',1)">
 <dtml-call "RESPONSE.setHeader('content-type', 'text/xml')"><?xml version="1.0"?>
 <rss version="2.0">
   <channel>
     <title><dtml-var title_or_id html_quote></title>
     <link><dtml-var URL1></link>
     <description>Recent Changes to <dtml-var title_or_id html_quote>.</description>
     <language>fr-fr</language>
 <dtml-comment><!-- (unrequired) Image requires checking for site_logo, using it(?) or using zwiki's built-in. -->
     <image>  
         <title><dtml-var title_or_id html_quote></title>
         <link><dtml-var URL1></link>
         <url><dtml-var URL1>/site_logo</url>    
     </image>  
 </dtml-comment>
 <!-- Yep, Catalog fails here, needs a pages() call -->
 <dtml-in "Catalog(sort_on='lastEditTime',sort_order='reverse')[:10]">
      <item>
           <title><dtml-var title_or_id html_quote></title>  
           <link><dtml-var URL1>/<dtml-var id></link>  
           <description>Page updated on <dtml-var lastEditTime fmt="%a, %d %b %Y %H:%M:%S +0000">. <dtml-var last_log missing="" html_quote> by <dtml-var last_editor missing="Anonymous" html_quote>. &lt;a href="<dtml-var URL1>/<dtml-var id>/diff"&gt;Diffs&lt;/a&gt;</description>
           <author><dtml-var last_editor html_quote missing="Anonymous"></author>
           <pubdate><dtml-var lastEditTime fmt="%a, %d %b %Y %H:%M:%S +0000"></pubdate>
      </item>
 </dtml-in>
 </channel>
 </rss>

-- Sig (http://sig.levillage.org/)

Enhancement request for RSS feeds -- Fri, 09 Jan 2004 00:31:45 -0800 reply
This is an enhancement suggestion for the RSS feeds above (I don't feel confident enough in my Zope/Zwiki skills to implement it right now, and I am a little bit to lazy to do it...). My suggestion is that, in these feeds, the URL of an RSS item should not be the URL of the wiki page but the URL of the last historical revision of this page.

Example : when the page MyPage? has been modified, the RSS file should not link to http://www.mysite.com/MyPage but to http://www.mysite.com/MyPage/HistoricalRevisions/850.15891.51176.22809

Explanation : The current RSS feeds (see above) link to MyPage?. Let's say that 5 users change MyPage? in the morning of a given day. The problem is that my RSS aggregator will check the RSS feed, let's say, once a day at noon. Then, my RSS aggregator will link to MyPage? and may provide a link to the latest diff of MyPage?. It is OK. But, during the afternoon, 5 additional users come and further change MyPage?. Then, when my RSS aggregator checks the RSS feed again (the day after), it will not notice that further changes have happened to MyPage? ! The current RSS feed does not allow the aggregator to detect that new changes have happened because the current RSS feed is not using the proper resource. The current resource used is the page itself whereas the paradigm of syndication/aggregation suggests that the proper elementary resource is the message (the revision or the diff itself). Or the users of aggregators may not be notified of recent changes of the wiki resources. And wiki pages will only appear in a given aggregator once during their whole life. Further changes may be ignored by the aggregator (because it may say : "I already have aggregated this URL before") which is not a good thing and which is not the fault of the aggregator !

What do you think ?

-- Sig (http://sig.levillage.org/)

new page --simon, Fri, 07 Jan 2005 12:44:41 -0800 reply
See also RSS. The current page is probably still the place to discuss this topic.

rss method --DeanG, Fri, 07 Jan 2005 13:33:05 -0800 reply

Another option might be one or more python method(s) built in to the product.

This is likely the best method to ensure properly escaped XML syntax.

I'm not sure what's required to have friendly HTTP headers (ETag?, Last-Modified*) for RSS feeds to reduce bandwith, but that is something that I've not been able to control via DTML.

Feeds: Latest: Edited, Changed, Deleted, Changed with Subject/Topic/Log, Latest Comments .. and a real esoteric one: limit page scope to this page and subtopics.

RSS versions --DeanG, Fri, 07 Jan 2005 13:35:09 -0800 reply
Using the latest ATOM version is a progressive stake-in-the-ground.

I've only worked with "RSS 2.0" myself (as that requires one pass over catalog, not two like some RDF varients) but would suggest that as the simplest. Further headbanging here: http://diveintomark.org/archives/2004/02/04/incompatible-rss

RSS of a page --DeanG, Fri, 07 Jan 2005 13:40:24 -0800 reply
Or RSS per Page comes in two flavors: contents chunked out into items, or contents history into items. History as RSS feed is not consistent with Zwiki's "since last db pack" convention.

Chunking the page into RSS feed works well with new comment system (especially with MailoutPolicyLogs) except there is no record of last document edit time vs. last comment time.

RSS of a page --Simon Michael, Fri, 07 Jan 2005 14:51:25 -0800 reply
Thanks, those are helpful.

Wiki refactoring ideas for this topic, if needed, are welcome. Here are a couple:

 Chapter 19: Zwiki and other things
  ZwikiAndRSS
   RSSFeeds (renamed)

 Chapter 19: Zwiki and other things
  RSSFeeds (combined into one)

 Chapter 19: Zwiki and other things
  ZwikiAndRSS (combined into one)

RSS of a page --simon, Fri, 07 Jan 2005 23:11:03 -0800 reply
I went with:

 Chapter 19: Zwiki and other things
  RSS
   RSSDiscussion

zwiki.org now has two rss 2.0 feeds that should be usable. The next thing is how do we store a real change log.

RSS versions -- Mon, 10 Jan 2005 12:41:23 -0800 reply
Atom 0.3 may be just as simple as RSS. This page shows a minimal and maximum view (below the fold), I didn't search long for other examples http://diveintomark.org/archives/2003/12/13/atom03

I created ChangeLog? for a place to gather info regarding a "real change log".

zwiki.org now has two rss 2.0 feeds that should be usable.

Which?

Per the ones in a page? Rss2 and Rss2Xml ? I made bother renderable by changing on of the page types. I'd suggest naming the one that's to be used as a code example to PlainText? (Then I'll remove the ugly <!-- comments.)

I don't believe these aren't usable as is for a dtml method.

RSS versions --Simon Michael, Tue, 18 Jan 2005 00:56:01 -0800 reply

zwiki.org now has two rss 2.0 feeds that should be usable.

Which?

I meant http://zwiki.org/pages_rss and http://zwiki.org/changes_rss (python scripts). They're now in the product as built-in methods, also: http://zwiki.org/FrontPage/pages_rss , http://zwiki.org/FrontPage/changes_rss .

Ted Leung's favorite RSS feed --DeanG, Wed, 30 Mar 2005 07:46:29 -0800 reply
at http://www.sauria.com/blog/2005/03/29#1264 Ted notes his appreciation for the 43 folders RSS feed with included diff, http://wiki.43folders.com/index.php?title=Special:Recentchanges&feed=rss

Including /diff information in the RSS feed is huge overhead. I haven't checked in the 43 folders contains MULTTIPLE diff's, either. A "diff's" log page, appended affter every edit, then formatted into an RSS feed seems the best solution here, although noisy. Best when condensed to items that have a subject/note/log.

Here's the OSAF TWiki RSS feed: http://wiki.osafoundation.org/bin/view/Chandler/WebRss?skin=rss