Skip to content

mediawiki-1.25 API incompatibility #69

@GreyCat

Description

@GreyCat

I have a mediawiki-gateway based bot that I'd like to run on http://ru.wikipedia.org/ - last time I tried it on about ~2013-12, and it was ok back then, but nowadays I always get the following error:

D, [2014-10-09T08:05:41.453869 #30170] DEBUG -- : GET:
{"action"=>"query", "prop"=>"info", "intoken"=>"edit",
"titles"=>"User:WebAnalyticsBot/testing", "format"=>"xml",
"maxlag"=>5}, {"ruwikiSession"=>"466dfb2ce72418b74400629b25975cc0",
"GeoIP"=>"RU%3AMoscow%3A55.7522%3A37.6156%3Av4", "Path"=>"%2F",
"Domain"=>".wikipedia.org", "centralauth_User"=>"WebAnalyticsBot",
"domain"=>".wikipedia.org", "centralauth_Token"=>"...",
"centralauth_Session"=>"...", "forceHTTPS"=>"true",
"ruwikiUserID"=>"1084957", "ruwikiUserName"=>"WebAnalyticsBot"}

D, [2014-10-09T08:05:41.741127 #30170] DEBUG -- : RES:
<api><warnings><info xml:space='preserve'>The intoken parameter has
been deprecated.</info></warnings><query><normalized><n
from='User:WebAnalyticsBot/testing'
to='User:WebAnalyticsBot/testing'/></normalized><pages><page
contentmodel='wikitext' counter=''
edittoken='a03becb45126ea2136e40e3f7cc2e1e2+\' lastrevid='60065217'
length='2' ns='2' pageid='4652026' pagelanguage='ru'
starttimestamp='2014-10-09T04:05:41Z'
title='User:WebAnalyticsBot/testing'
touched='2013-12-12T18:01:51Z'/></pages></query></api>

/var/lib/gems/2.1.0/gems/mediawiki-gateway-0.6.2/lib/media_wiki/gateway.rb:1071:in
`warning': API error: code 'warning', info 'API warning: The intoken
parameter has been deprecated.' (MediaWiki::APIError)

Basically, it seems that mediawiki-gateway tries to use
action=query&prop=info&intoken=edit stuff, which seems to be
deprecated now
:

* prop=info (in) *
  Get basic page information such as namespace, title, last touched date, ...
  https://www.mediawiki.org/wiki/API:Properties#info_.2F_in
[...]
  intoken             - DEPRECATED! Request a token to perform a data-modifying action on a page

It's probably a fairly vital issue, as it makes mediawiki-gateway totally unusable in current Wikipedia's installation environments, at least out of the box.

As far as I understand, it's not necessary to request a token, it would be given out automatically anyway in modern Mediawiki installations - probably this could be simply fixed by removing intoken= setting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions