[Mediawiki-l] automatically inserting content into the wiki
Johannes Perl
johannes.perl at gmail.com
Thu Aug 30 22:16:00 UTC 2007
Adam Meyer wrote:
> I actually have a php scrpt that does just this.
> There is a list of variables that are needed to make a new page.
> These are the ones I have, and it works perfectly.
>
> This only works for new pages. It will not work for edits as more
> info is needed.
>
> ['wpTextbox1'] = 'info for the page here';
> ['wpSummary'] = "";
> ['wpSection'] = "";
> ['wpEdittime'] = "";
> ['wpMinoredit'] = "1";
> ['wpSave'] = "Save page";
> ['wpEditToken'] = $token;
>
>
> wpEditToken is actually taken from the page in my script.
>
> here is more info on it:
> http://www.mediawiki.org/wiki/Manual:Edit_token
>
>
> -Adam
>
>
> On Aug 29, 2007, at 11:28 AM, Johannes Perl wrote:
>
> > hi,
> >
> > I'm trying to write a programm with java to insert content
> > automatically
> > into the wiki.
> > I set the POST variables and the submit button value and then send
> > the request to the server. Now comes the problem that MediaWiki
> > doesn't let me
> > post anything.
> > The page returned is only the preview page, but exactly with the
> > content I
> > wanted to post.
> >
> > So I've got the question whether there are any special variables to
> > be set.
> > Looking at the source code I saw that there are some hidden fields.
> > Do they all have to be set to get this posted?
> > Or are there any other problems or things I have to consider?
> >
> > Thanks for any help or links.
> > Johannes
> > _______________________________________________
> > MediaWiki-l mailing list
> > MediaWiki-l at lists.wikimedia.org
> > http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks to both of you. I made it work.
It was the problem with wpEdittoken, since I got logged in via ldap.
Deactiving ldap it worked. For others having same problems, it's a
really good tip enable debugging.
To be able to do edits I simply read all input tags from the site,
eliminated the preview and diff button and sent all the others as post
variables.
-Johannes
--
More information about the MediaWiki-l
mailing list