Regis May
Regis May

Reputation: 3466

MediaWiki: How to resolve "descriptionmsg" value retrieved via API?

Via http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions you can retrieve information about the MediaWiki extensions installed. The result format is documented at https://www.mediawiki.org/wiki/API:Siteinfo and states that for each extension descriptionmsg contains a system message name. This is not the description itself but a key to a description string.

My question is: I have the key from descriptionmsg, now how do I obtain the description string (via the API)?

Upvotes: 0

Views: 45

Answers (2)

FO-nTTaX
FO-nTTaX

Reputation: 611

MediaWiki has an API module in its action API called allmessages, it can be called like https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc

Check out its documentation here: https://www.mediawiki.org/wiki/API:Allmessages

Upvotes: 2

AXO
AXO

Reputation: 9096

You can retrieve the contents of https://en.wikipedia.org/wiki/MediaWiki:[descriptionmsg_value]

Replace [descriptionmsg_value] with the actual value. For example given "descriptionmsg":"timedmediahandler-desc" the related page is https://en.wikipedia.org/wiki/MediaWiki:timedmediahandler-desc.

There are several ways to get the contents of a page. Refer to API:Get the contents of a page for more information.

Upvotes: 0

Related Questions