Editing a wiki

Paul Boddie paul at boddie.org.uk
Tue Aug 18 17:32:11 EDT 2009


On 18 Aug, 23:02, KillSwitch <gu.yakahug... at gmail.com> wrote:
> Hey guys,
> Is it possible to edit a wiki page with python, including logging in
> to edit the page, and inserting text into the edit box, etc. I was
> thinking maybe python would be the language to do this in, because I
> have to iterate through every line in a text file and gather info
> about what to enter in the wiki that way, then put that text in a wiki
> page.

What you seem to want is a way of interacting with Web forms, and
there are various Python client libraries which do this:

http://wiki.python.org/moin/WebClientProgramming

However, see below.

>       It's sort of a program-documenting program. If it's possible to
> do this, I would make a special way of entering comments in the source
> files, like maybe --[[##title code here]] and then --[[@@code example
> here]] with the two symbols at the beginning of the comment dictating
> what to enter where. Thanks for any input.

Generally, you have to be careful interacting with Web sites in an
automated fashion: Wiki sites in particular often have measures in
place to deter "robots" and behaviour which looks like spamming. If
the Wiki is under your control, you'd be better off uploading content
via the data store (such as the filesystem for MoinMoin and some other
Wiki solutions) or via specific mechanisms provided for administration
of the Wiki.

Paul



More information about the Python-list mailing list