DokuWiki maakt een deel van haar data beschikbaar als XML feed via feed.php-bestand. De feed kan worden toegevoegd aan een nieuwslezer.
De XML Syndication functie is geïmplementeerd door de uitmuntende Feed Maker Class te gebruiken geprogrammeerd door Kai Blankenhorn.
Hoe de feed wordt samengesteld kan worden ingesteld door verschillende configuratieopties. Als feed.php wordt opgevraagd zonder een extra paramaters zal het deze opties gebruiken om de feed samen te stellen. Alle opties kunnen overschreven worden door parameters aan de URL toe te voegen.
Elk item in de aangemaakte feed zal een link hebben; deze optie specificeert waar deze link naar wijst.
Waarde | Linkdoel |
---|---|
page | de revisie van de pagina toen de feed gemaakt werd |
current | de meest actuele versie van de pagina |
rev | de revisieoverzicht van de pagina |
diff | een diff-weergave van de paginawijzigingen |
Wat in de itemblokken van de feed wordt weergegeven wordt met deze optie ingesteld.
Waarde | Iteminhoud |
---|---|
abstract | De eerste paragraaf van een pagina |
diff | een kale tekst diff van de paginawijzigingen |
htmldiff | een HTML-opgemaakte diff tabel van de paginawijzigingen |
html | de volledige in HTML omgezette paginainhoud |
DokuWiki kan de XML-feed samenstellen in meerdere formaten.
Waarde | Feed-formaat |
---|---|
rss | RSS 0.91 |
rss1 | RSS 1.0 |
rss2 | RSS 2.0 |
atom | ATOM 0.3 |
atom1 | ATOM 1.0 |
feed.php kan worden gebruikt voor de uitvoer van een lijst van de recente aanpassingen (standaard) maar ook voor andere lijsten.
Waarde | Lijstmode |
---|---|
recent | lijst van de meestrecente pagina's met de nieuwste bovenaan |
list | simpele lijst van alle pagina's van een namespace (zie hieronder voor een selecteren van welke namespace) |
search | lijst van pagina's die overeenkomen met een bepaalde zoekopdracht gegeven door een extra URL-parameter q |
De feed kan worden beperkt tot het weergeven van pagina's uit één bepaalde namespace.
In list mode list
, the feed will contain pages from the given namespace only, no sub namespaces.
In list mode recent
, sub namespaces are included.
Namespace limitation is not directly supported for the list mode search
. Instead you can give a namespace limitation in the query (using the @
syntax) – this however will include sub namespaces.
The number of pages listed in the feed can be controlled as well.
By default no minor edits will be shown in the feed. This can be changed by an URL argument.
XML feeds are cached to reduce the load on the wiki. This option controls how long feed caches are valid.
The summary of a page change will usually be included in the feed item title. This might be unwanted sometimes and can be disabled.
When ACLs are enabled, read restricted pages will not be included in public feeds.
If you want to access feeds for restricted pages you have to pass your username and password along in the URL like this: ''http://example.com/dokuwiki/feed.php?u=username&p=password''.
This is not very secure and might lead to the leakage of your user credentials. When DokuWiki is running atop of mod_php
passing login credentials via HTTP Basic Auth as supported by some newsreaders might work as well.
For my configuration (dokuwiki 2008-05-05 and Liferea) the HTTP Basic Auth approach did not work out of the box. It seems that the authentication was not happening because the web server did not ask for it. So I forced this by creating a .htusers file (out of the dokuwiki user information) and restrict the access to feed.php:
I used the following simple script to generate a htusers file (used by apache) out of dokuwikis user data:
user@host# cat <<EOF > update_htusers #!/bin/sh grep -v '^#' users.auth.php | cut -sd\: -f1,2 > .htusers EOF user@host# chmod +x update_htusers user@host# ./update_htusers
Add to your existing .htaccess in dokuwiki main folder:
AuthType Basic AuthName "feed" AuthUserFile path-to-your-htusers-file <Files feed.php> Order deny,allow require valid-user </Files>