[pmwiki-users] create pages externally through bash- / php-script?

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 24 11:44:21 CDT 2006

On Thu, Aug 24, 2006 at 11:44:54AM +0200, Thomas -Balu- Walter wrote:
> Hello all,
> is there a way to create / update a page using an external script?
> The idea is to daily ask our routers for their configuration and update
> their corresponding wiki pages. Simply POSTing a new page will get
> difficult as all pages are password protected.

It's not difficult if whatever is doing the POST can send a long a
password as well.  :-)  And it's not at all hard to send along a 
password, the password just goes in an "authpw" field along with 
the rest of the posted content (i.e., one doesn't have to check for
an authorization prompt and send the password in a separate POST,
maintain cookies, etc.).

Of course, it's possible to get PmWiki to update the pages as well--
write a recipe that adds a new ?action= that queries the routers
for configuration and rewrites the appropriate pages (via calls
to WritePage).  Then arrange for cron(1) to call PmWiki once per day
with the special ?action= value to do the updates.  

> What I've noticed while playing with this idea is that pmwiki pages get
> saved even if nothing was changed. I wonder if this should be changed so
> it only get's saved if the content differs?

PmWiki used to save changes only if content differed, but sometimes
we want to force a page save because of attributes being updated or
other changes in the configuration.

Still, it's not at all hard to configure PmWiki to save pages only
when the content changes -- let me know if you need the code for
this and I'll post it as a recipe.


More information about the pmwiki-users mailing list