Hi everyone, When using generators is there any way to get the pages element to be an array? For example the next json [1]: { "query": { "pages": { "827359": { "pageid": 827359, "ns": 0, "title": "mean-spirited" }, "2216064": { "pageid": 2216064, "ns": 0, "title": "mean air mhean" } } } }
What I'm looking for is this: { "query": { "pages": [ { "page": { "pageid": 827359, "ns": 0, "title": "mean-spirited" } }, { "page": { "pageid": 2216064, "ns": 0, "title": "mean air mhean" } } ] } }
If I format it as xml [2] the "pages" element has "page" sub-elements and the "pageid" is an attribute to those. I would expect json to behave in a similar way.
Thanks, Ramon
[1] http://en.wiktionary.org/w/api.php?format=jsonfm&action=query&genera...
[2] http://en.wiktionary.org/w/api.php?format=jsonfm&action=query&genera...
2010/11/30 oni oni.pool@gmail.com:
Hi everyone, When using generators is there any way to get the pages element to be an array?
Use the &indexpageids=1 parameter, that'll supply you with an array of page IDs used in the response.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org