Hi,
I had problems because of the +\ in Bash. I was replacing those with their HTML encodings but that was preventing the code from functioning.
Are you trying to add an edit request to that paste?
Yes. Can I just pass the CSRF token ("edit token") to action=edit and expect the MediaWiki API to know who I am?
This is the way I'm getting the CSRF token: CR=$(curl -S \ --location \ --cookie $cookie_jar \ --cookie-jar $cookie_jar \ --user-agent "Curl Shell Script" \ --keepalive-time 60 \ --header "Accept-Language: en-us" \ --header "Connection: keep-alive" \ --compressed \ --request "POST" "${WIKIAPI}?action=query&meta=tokens&format=json")
Kind regards, Geoffrey
---- On ma, 30 jan 2017 21:08:13 +0100 Gergo Tisza gtisza@wikimedia.org wrote ----
It's not really clear what you are asking. Are you trying to add an edit request to that paste? What part of it is problematic?
(In any case, you probably want to use bot passwords, not clientlogin. It does work but is not ideal.)
On Mon, Jan 30, 2017 at 11:20 AM, geoffreydebelie geoffreydebelie@zoho.com wrote:
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Hi,
I'm trying to append text to a page as logged in MediaWiki user from within Bash.
I tried this, but it's very outdated: https://www.mediawiki.org/wiki/API:Client_code/Bash
I had updated it to this: http://pastebin.com/e9LF3UDa
I want to use this: https://www.mediawiki.org/wiki/API:Edit#Editing_pages -> appendtext
Can someone please provide me with at least a partial solution? I'm lost.
Kind regards, Geoffrey De Belie
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api