通过http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions,您可以检索有关已安装的MediaWiki扩展的信息。结果格式记录在https://www.mediawiki.org/wiki/API:Siteinfo中,并指出对于每个扩展名descriptionmsg
都包含系统消息名称。这不是描述本身,而是描述字符串的键。
我的问题是:我有descriptionmsg
的密钥,现在如何获取描述字符串(通过API)?
您可以检索https://en.wikipedia.org/wiki/MediaWiki:[descriptionmsg_value]的内容
用实际值代替[descriptionmsg_value]
。例如,给定"descriptionmsg":"timedmediahandler-desc"
,相关页面为https://en.wikipedia.org/wiki/MediaWiki:timedmediahandler-desc。
有几种获取页面内容的方法。有关更多信息,请参见API:Get the contents of a page。
MediaWiki在其动作API中有一个称为allmessages的API模块,可以像https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc那样调用>