On Wed, Mar 18, 2009 at 11:06 AM, Roan Kattouw roan.kattouw@home.nl wrote:
http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=...
Note that namespaces with an ID of 100 or higher are specific to enwiki and may have different names or not be used at all on other wikis. To get an accurate list for another wiki, ask that wiki's api.php .
The same is pretty much true for all namespaces. There's no guarantee that any namespaces other than main will have the same names on other wikis. To ensure that, you need to use the canonical name if one exists (it's helpfully provided in the API result . . . actually, what does it mean that "Portal" and "Portal talk" are canonical? shouldn't there be no canonical attribute if the namespace is custom?).
In particular, "Wikipedia" and "Wikipedia talk" will likely not work on most other wikis.
On Wed, Mar 18, 2009 at 11:54 AM, O. O. olson_ot@yahoo.com wrote:
Thanks Petr and Aryeh for getting back. From the Documentation at http://www.mediawiki.org/wiki/Page_table and http://meta.wikimedia.org/wiki/Help:Namespace you can get the names of the Real and Virtual Namespeaces in includes/Defines.php and then get what text they convert to in English using languages/messages/MessagesEn.php.
This is fine, but where can I find information on custom namespaces i.e. those that lie above 100.
Use Roan's link:
http://en.wikibooks.org/w/api.php?action=query&meta=siteinfo&siprop=...
You might prefer this to Defines.php/MessagesEn.php. Those will give you the canonical names, which will always work, but which might not be the ones used on Wikipedia. For instance, namespace 4 is canonically "Project", but on Wikipedia the normal name for it is "Wikipedia". "Project" URLs will work on Wikipedia, but automatically redirect to "Wikipedia". E.g.,