I'm querying the API to get the categories and subcategories for a page, and I'd like to be able to exclude hidden categories and administration categories from the result. The queries that I currently use look like this:
Category Pages:
http://en.wikipedia.org/w/api.php?action=query&titles=Category:$catname&... tle=Category:$catname&list=categorymembers&cmlimit=500&prop=categories&forma t=php
Non-Category Pages:
http://en.wikipedia.org/w/api.php?action=parse&page=$pagename&prop=t... gories&redirects&format=php
where $catname and $pagename are replaced by the page titles. Is there a way to either exclude categories that are hidden categories, or that are subcategories of the "Category:Hidden categories" category?
Thanks,
Robert
Have you tried appening clshow=!hidden as shown under prop=categories (cl) * ?
I have used it in the past for a different query.
Thanks
Prateek
On Mon, Dec 31, 2012 at 6:17 PM, Robert Crowe robert@ourwebhome.com wrote:
I'm querying the API to get the categories and subcategories for a page, and I'd like to be able to exclude hidden categories and administration categories from the result. The queries that I currently use look like this:****
Category Pages:****
http://en.wikipedia.org/w/api.php?action=query&titles=Category:$catname&...
Non-Category Pages:****
http://en.wikipedia.org/w/api.php?action=parse&page=$pagename&prop=t...
where $catname and $pagename are replaced by the page titles. Is there a way to either exclude categories that are hidden categories, or that are subcategories of the "Category:Hidden categories" category?****
Thanks,****
Robert****
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org