mediawiktory icon indicating copy to clipboard operation
mediawiktory copied to clipboard

Token management

Open zverok opened this issue 9 years ago • 0 comments

All data-modifying actions require some dance with "tokens". It should be done transparently for user. See https://www.mediawiki.org/wiki/API:Tokens

Note, that token management have different behavior in:

  • versions < 1.20
  • version 1.20-1.23
  • version 1.24+

See also #9 about version compatibility

NB: Current version of "manual" token management is:

token = api.query.meta(:tokens).response.dig('tokens', 'csrftoken')
response = api.edit.title('Wikipedia:Sandbox').text("Test '''me''', MediaWiktory!").token(token).response

It is, in fact, not that bad, and probably not worth over-automatization at all.

zverok avatar Dec 01 '15 09:12 zverok