Hello Brad,
thank you for your fast response! I extended my script with your additions and it works now! :-)
I also tried the save/load cookies before but.... --keep-session-cookies was the showstopper!
With this setting it works!
Thanks Andreas
2013/9/27 Brad Jorsch (Anomie) bjorsch@wikimedia.org
On Thu, Sep 26, 2013 at 5:58 PM, Andreas Mrvka andreas.mrvka@gmail.com wrote:
wget --http-user=myuser --http-password=mypwd "
https://localhost/wiki/api.php?action=query&prop=info%7Crevisions&in...
[...]
wget --http-user=myuser --http-password=mypwd --header="Content-Type: application/x-www-form-urlencoded" "https://localhost/wiki/api.php" --post-data "action=edit&title=mynewpage&text=test&token=$newtoken"
Besides percent-encoding the edit token, you also need to pass back the cookies from the first request into the second.
You'll want to give the --keep-session-cookies and --save-cookies options to the first wget command, and additionally --load-cookies to the second.
-- Brad Jorsch (Anomie) Software Engineer Wikimedia Foundation
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api