jpatokal / mediawiki-gateway

Ruby framework for MediaWiki API manipulation
Other
133 stars 50 forks source link

use new meta method to fetch token #91

Open MusikAnimal opened 8 years ago

MusikAnimal commented 8 years ago

Per API:Tokens, with MediaWiki v1.24 or later we should be fetching a token via action=query&meta=tokens, disregarding the page we are actioning on. This of course means we are dropping support for earlier MediaWiki versions. Maybe there's a way to check which version they are using?

jpatokal commented 8 years ago

Thanks, but since people often use this to connect to older versions I can't accept a breaking change. Can you rewrite this either to try/catch both methods, or poke at eg. https://www.mediawiki.org/wiki/API:Siteinfo and check the version there?