Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
[Wanted] Continuous list of pages being read/edited/created to CSV (or similar)
To feed an IM chatbot (outside of DokuWiki) which will tell listeners about wiki edits etc.
Avatar
FosseWay #1
Member since May 2016 · 118 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
Subject: [Wanted] Continuous list of pages being read/edited/created to CSV (or similar)
What I have:
  • a DokuWiki installation serving as a fairly busy corporate KB
  • API access to an [internal/proprietary] IM service

What I want is some sort of continually updated plain-text file (or similar) on the webserver which could be read by a script outside of DokuWiki; the script would then pass information to the IM service API, so that IM users could receive messages about new/edited/viewed pages on the wiki.

For example:
[11:35] WikiBot: User Jane.Doe has edited page "Access Controls" under namespace "Procedures/Security"

Because the IM service in question is proprietary, I'm not looking for anything to do with the IM-facing portion of this question; just need to figure out the easiest way to get a plain-text feed of page updates/views.

I'm sure I could write something to parse Apache logs, but that seems like overkill. I suspect I'm overlooking a simple solution, so I'm hoping someone can point me at the missing puzzle piece.
Avatar
andi (Administrator) #2
User title: splitbrain
Member since May 2006 · 3520 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
data/meta/_dokuwiki.changes has what you want (tab separated). You could also write an action plugin that directly feeds you IM API.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
FosseWay #3
Member since May 2016 · 118 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
Thanks andi, both for this very quick and useful answer, and for moving my post to a more appropriate forum. I'll use Development for this sort of thing in future.

Quote by andi:
You could also write an action plugin that directly feeds you IM API.
True, but I probably won't attempt a plugin to do that, since I have [almost] all the code I need to make my bot do this already in a context outside DokuWiki, so all I need to do is iterate through the text file and extract variables. Also, in my scenario, there are some fairly strict access controls in place, which mean it's easier for me to monitor the text file on the DokuWiki host from another host, which then accesses the IM API (this is certainly not your problem!)

On the other hand, I can see that one advantage of my writing a plugin would be easy access to richer info like the "first heading" page name, rather than only the underlying page name.

I couldn't see any file recording user page views, other than access.log; is there something simple and similar to _dokuwiki.changes which would allow me to do something like:
[11:27] WikiBot: User Jane.Doe is reading page "Leap Year special procedures" under namespace "Procedures/Calendar"
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 07:28:44 (UTC +01:00)