Hi guys,
When I do a query for categories using the API I would only like to get the categories that are listed in the wiki page. For example when I query the Brocoli page, I get this:
<categories> <cl ns="14" title="Category:All articles with unsourced statements"/> <cl ns="14" title="Category:Articles containing Italian-language text"/> <cl ns="14" title="Category:Articles with 'species' microformats"/> <cl ns="14" title="Category:Articles with unsourced statements from January 2013"/> <cl ns="14" title="Category:Brassica oleracea"/> <cl ns="14" title="Category:Commons category with local link same as on Wikidata"/> <cl ns="14" title="Category:Cultivars"/> <cl ns="14" title="Category:Edible plants"/> <cl ns="14" title="Category:Inflorescence vegetables"/> <cl ns="14" title="Category:Pages with citations having bare URLs"/> </categories>
But I am only interested in these (You'll see it at the bottom of this page http://en.wikipedia.org/wiki/Brocoli):
<cl ns="14" title="Category:Brassica oleracea"/> <cl ns="14" title="Category:Cultivars"/> <cl ns="14" title="Category:Edible plants"/> <cl ns="14" title="Category:Inflorescence vegetables"/>
I was wondering if there is any workaround this?
Thanks Chux
You can specify clshow=!hidden to omit the "hidden" categories that, by default, are not shown at the bottom of a page:
http://en.wikipedia.org/w/api.php?action=query&prop=categories&title...
-Ran
On Wed, Jul 3, 2013 at 11:07 PM, Chux chux18@gmail.com wrote:
Hi guys,
When I do a query for categories using the API I would only like to get the categories that are listed in the wiki page. For example when I query the Brocoli page, I get this:
<categories> <cl ns="14" title="Category:All articles with unsourced statements"/> <cl ns="14" title="Category:Articles containing Italian-language text"/> <cl ns="14" title="Category:Articles with 'species' microformats"/> <cl ns="14" title="Category:Articles with unsourced statements from January 2013"/> <cl ns="14" title="Category:Brassica oleracea"/> <cl ns="14" title="Category:Commons category with local link same as on Wikidata"/> <cl ns="14" title="Category:Cultivars"/> <cl ns="14" title="Category:Edible plants"/> <cl ns="14" title="Category:Inflorescence vegetables"/> <cl ns="14" title="Category:Pages with citations having bare URLs"/> </categories>
But I am only interested in these (You'll see it at the bottom of this page http://en.wikipedia.org/wiki/Brocoli):
<cl ns="14" title="Category:Brassica oleracea"/> <cl ns="14" title="Category:Cultivars"/> <cl ns="14" title="Category:Edible plants"/> <cl ns="14" title="Category:Inflorescence vegetables"/>
I was wondering if there is any workaround this?
Thanks Chux
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
On Wednesday, July 3, 2013, Ran Ari-Gur wrote:
You can specify clshow=!hidden to omit the "hidden" categories that, by default, are not shown at the bottom of a page:
Is there a way to do this for action=parse so that only a single query needs to be made? I noticed that asking action=parse for the categories in html shows had tags with the hidden status encoded in them, but the XML returned in the categories does not mark hidden categories.
Thanks,
Robert
mediawiki-api@lists.wikimedia.org