[Home]UseModAccess

UseModWiki | RecentChanges | Preferences

This is primitive sample code to access pages in the UseModWiki database from other perl programs.

package UseModWiki; # yeah, I know...
$_ = 'nocgi';
require "/Users/towb/MyWeb/htdocs/wiki.pl";

From DoWikiRequest:

if ($UseConfig && (-f "$DataDir/config")) {
  do "$DataDir/config";
}
&InitLinkPatterns();

A CGI object is used for error messages and parameters. SaveSection uses the global $q to get "username". We can either call InitRequest and pass it via STDIN or do the following:

  $Now = time;
  $q = new CGI({username => "TobiasWeber?"});
  $UserID = 1011; # user must exist

The Rest is simple:

 OpenPage("ToDo?");
 OpenDefaultText();

 print $Section{ts}; # last edit time stamp
 $Text{text} .= "All Done"; # just work on those variables

 SaveDefaultText?();
 SavePage?();

Of course your script has to have the same permissions as wiki.pl which would usually run as "www".


UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited July 24, 2002 8:21 pm by pec-92-168.tnt5.f.uunet.de (diff)
Search: